lkml.org 
[lkml]   [2022]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [Patch v4 06/12] net: mana: Define data structures for protection domain and memory registration
Date
> From: Ajay Sharma <sharmaajay@microsoft.com>
> Sent: Tuesday, July 12, 2022 9:39 PM
> To: Dexuan Cui <decui@microsoft.com>; Long Li <longli@microsoft.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.

\
 
 \ /
  Last update: 2022-07-13 09:23    [W:0.221 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site