RE: [Patch v4 06/12] net: mana: Define data structures for protection domain and memory registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Ajay Sharma <sharmaajay@xxxxxxxxxxxxx>
> Sent: Tuesday, July 12, 2022 9:39 PM
> To: Dexuan Cui <decui@xxxxxxxxxxxxx>; Long Li <longli@xxxxxxxxxxxxx>; 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.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux