Messages in this thread | | | From | Dexuan Cui <> | Subject | RE: [Patch v4 06/12] net: mana: Define data structures for protection domain and memory registration | Date | Wed, 13 Jul 2022 07:22:19 +0000 |
| |
> 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.
| |