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

2012-03-23 Thread Parav.Pandit
..@vger.kernel.org; net...@vger.kernel.org > Subject: Re: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA > adapter > > 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 >

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 f

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

2012-03-23 Thread Parav.Pandit
e: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA > adapter > > On Thu, Mar 22, 2012 at 02:20:28PM -0700, parav.pan...@emulex.com > wrote: > > I got a question here lately. > > > > aligned directive will ensure that it will fall on boundary. Say > > aligne

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 i

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

2012-03-22 Thread Roland Dreier
On Thu, Mar 22, 2012 at 3:44 PM, Jason Gunthorpe wrote: > For hardware facing structures I'd combine this with a static assert > to verify structure size at compile time. > > So.. > > 1) Avoid using attributes unless the structure has unaligned members. > 2) Avoid creating structures with unaligne

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

2012-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2012 at 02:20:28PM -0700, parav.pan...@emulex.com wrote: > I got a question here lately. > > aligned directive will ensure that it will fall on boundary. Say > aligned(4) ensures that structure is aligned to 4 byte boundary. > Compiler can (at least theoretically) still have 4 byt

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

2012-03-22 Thread Parav.Pandit
storage.com; linux- > r...@vger.kernel.org; net...@vger.kernel.org > Subject: RE: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA > adapter > > > > > -Original Message- > > From: Jason Gunthorpe [mailto:jguntho...@obsidianresearch.com] > > Sent:

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

2012-03-22 Thread Parav.Pandit
e: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDMA > adapter > > On Thu, Mar 22, 2012 at 01:52:30PM -0700, parav.pan...@emulex.com > wrote: > > > > This can be used to force 32bit alignment in amd64 code in order to > > > match definitions in 32bit usersp

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

2012-03-22 Thread Jason Gunthorpe
On Thu, Mar 22, 2012 at 01:52:30PM -0700, parav.pan...@emulex.com wrote: > > This can be used to force 32bit alignment in amd64 code in order to match > > definitions in 32bit userspace. > > For new things it would make sense to force 64bit alignment of 64bit fields > > for 32bit code. > > o.k. s

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

2012-03-22 Thread Parav.Pandit
> -Original Message- > From: David Laight [mailto:david.lai...@aculab.com] > Sent: Wednesday, March 21, 2012 10:02 PM > To: Roland Dreier; Pandit, Parav > Cc: linux-rdma@vger.kernel.org; net...@vger.kernel.org > Subject: RE: [PATCH 2/9] ocrdma: Driver for Emulex OneConn

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

2012-03-21 Thread Parav.Pandit
ed. Parav > -Original Message- > From: Roland Dreier [mailto:rol...@purestorage.com] > Sent: Wednesday, March 21, 2012 9:50 PM > To: Pandit, Parav > Cc: linux-rdma@vger.kernel.org; net...@vger.kernel.org > Subject: Re: [PATCH 2/9] ocrdma: Driver for Emulex OneConnect RDM

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

2012-03-21 Thread Hefty, Sean
> +struct ocrdma_alloc_ucontext_resp { > + u32 dev_id; > + u32 wqe_size; > + u32 max_inline_data; > + u32 dpp_wqe_size; > + u64 ah_tbl_page; > + u32 ah_tbl_len; > + u32 rsvd; > + u8 fw_ver[32]; > + u32 rqe_size; > + u64 rsvd1; > +} __packed; Is there some re

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

2012-03-21 Thread David Laight
> > - Header file for userspace library and kernel driver interface. > > > +struct ocrdma_alloc_ucontext_resp { > > +       u32 dev_id; > > +       u32 wqe_size; > > +       u32 max_inline_data; > > +       u32 dpp_wqe_size; > > +       u64 ah_tbl_page; > > +       u32 ah_tbl_len; > > +       u3

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

2012-03-21 Thread Roland Dreier
On Tue, Mar 20, 2012 at 3:39 PM, wrote: > From: Parav Pandit > > - Header file for userspace library and kernel driver interface. > +struct ocrdma_alloc_ucontext_resp { > +       u32 dev_id; > +       u32 wqe_size; > +       u32 max_inline_data; > +       u32 dpp_wqe_size; > +       u64 ah_tbl_