RE: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA adapter

2012-03-23 Thread David Laight
struct { u64 fielda u32 field; }; In this case: On 64 bit: the u64 is aligned to 8 and the u32 is aligned to 4. So the structure is aligned to 8. A pad is inserted at the end of the struct to bring it out. On 32 bit, the u64 is aligned to 4, so the struct is aligned to

RE: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA adapter

2012-03-23 Thread Parav.Pandit
-Original Message- From: Jason Gunthorpe [mailto:jguntho...@obsidianresearch.com] Sent: Friday, March 23, 2012 4:14 AM To: Pandit, Parav Cc: david.lai...@aculab.com; rol...@purestorage.com; linux- r...@vger.kernel.org; net...@vger.kernel.org Subject: Re: [PATCH 2/9] ocrdma: Driver

Re: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA adapter

2012-03-23 Thread Jason Gunthorpe
On Fri, Mar 23, 2012 at 07:03:37AM -0700, parav.pan...@emulex.com wrote: David is saying you will get a 12 byte struct and fieldb will be unaligned. Since 12 is aligned to 4 no padding is added. So I decided to experiment above example before implementing in driver. However I find

RE: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA adapter

2012-03-23 Thread Parav.Pandit
Got it. You did mention about typedef in email chain, but I understood as different way to achieve same. I reviewed my code and found that most of the fields between driver-adapter doesn't need attribute. So far (a) removing packed and (b) BUILD_BUG_ON looks sufficient for current set of