Thread (1 message) 1 message, 1 author, 2012-03-21

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

flat view

From: Roland Dreier <hidden>
Date: 2012-03-21 16:20:00
Also in: linux-rdma

On Tue, Mar 20, 2012 at 3:39 PM,  [off-list ref] wrote:
From: Parav Pandit <redacted>

- Header file for userspace library and kernel driver interface.
quoted hunk
+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;
If I'm reading this correctly, you have the 8-byte rsvd1 member at an
offset only aligned to 4 bytes, because of the __packed directive.  It
would be much better to have these structures laid out so they are
naturally the same on both 32-bit and 64-bit ABIs, and get rid of the
__packed directive, which wrecks gcc code generation in some cases.

In this particular case, it seems you could just move rqe_size into the
slot where rsvd is, and get rid of rsvd1?
quoted hunk
+/* user kernel communication data structures. */
+struct ocrdma_alloc_pd_ureq {
+       u64 rsvd1;
+} __packed;
Similar comment -- __packed is silly for a structure with one reserved
member (and which you don't seem to use anywhere)... why not just
delete this struct?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help