[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR2101MB13273A97F6709C7752F37A87BF899@SN6PR2101MB1327.namprd21.prod.outlook.com>
Date: Wed, 13 Jul 2022 07:22:19 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: Ajay Sharma <sharmaajay@...rosoft.com>,
Long Li <longli@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"shiraz.saleem@...el.com" <shiraz.saleem@...el.com>
CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [Patch v4 06/12] net: mana: Define data structures for protection
domain and memory registration
> From: Ajay Sharma <sharmaajay@...rosoft.com>
> Sent: Tuesday, July 12, 2022 9:39 PM
> To: Dexuan Cui <decui@...rosoft.com>; Long Li <longli@...rosoft.com>; KY
> ...
> > The definition of struct gdma_create_mr_params is not naturally aligned.
> > This can potenially cause issues.
> This is union and so the biggest element is aligned to word. I feel since this is
> not passed to the hw it should be fine.
Ajay, you're right. I didn't realize struct gdma_create_mr_params is not really
passed to the PF driver or the device. Please ignore my comments on
struct gdma_create_mr_params. Sorry for the confusion!
> > BTW, Haiyang added "/* HW DATA */ " to other definitions, e.g.
> > gdma_create_queue_resp. Can you please add the same comment for
> > consistency?
It's still recommended that we add the tag "/* HW DATA */ " to new definitions
that are passed to the PF driver or the device.
> > +struct gdma_create_mr_request {
> > + struct gdma_req_hdr hdr;
> > + gdma_obj_handle_t pd_handle;
> > + enum gdma_mr_type mr_type;
> > + u32 reserved;
> > +
> > + union {
> > + struct {
> > + enum gdma_mr_access_flags access_flags;
> > + } gpa;
> > +
> > + struct {
> > + gdma_obj_handle_t dma_region_handle;
> > + u64 virtual_address;
> > + enum gdma_mr_access_flags access_flags;
>
> Similarly, there is a hidden u32 field here. We should explicitly define it.
The issue with struct gdma_create_mr_request is valid, since it's
passed to the PF driver. We should explicitly define the hidden field.
Powered by blists - more mailing lists