[openib-general] [PATCH 4/7] IB/ipath - performance improvements via mmap of queues
Ralph Campbell
ralphc at pathscale.com
Mon Aug 14 13:38:42 PDT 2006
On Mon, 2006-08-14 at 12:37 -0700, Roland Dreier wrote:
> ralphc> This doesn't break compatibility. uverbs_cmd.c
> ralphc> ib_uverbs_resize_cq() allocates a struct
> ralphc> ib_uverbs_resize_cq_resp on the stack but only reads the
> ralphc> first element in. The structure change isn't really
> ralphc> needed at all since the INIT_UDATA() macro gets the start
> ralphc> of driver_data from the struct ib_uverbs_resize_cq. The
> ralphc> change to ib_uverbs_resize_cq_resp just matches the
> ralphc> structure change used by libipathverbs to initialize
> ralphc> ib_uverbs_resize_cq.response.
>
> Am I missing something? Think about the case of old libibverbs, new
> kernel. libibverbs allocates a 4-byte response structure and passes
> the pointer to that to the kernel. The kernel allocates an 8-byte
> response structure and copies it back to userspace. And the 4 bytes
> after the userspace response structure get zeroed.
>
> - R.
No, I was missing something :-)
You are correct. The structure change was needed
to get the alignment correct for returning a u64
after the struct ib_uverbs_resize_cq_resp.
I can avoid the incompatibility a number of ways:
1) change ib_uverbs_resize_cq() to only copyout resp.cqe.
2) change ib_ipath to ALIGN the udata->outbuf address.
3) define two resp structures, check the version, copyout the
right one.
Seems like #1 is the simplest to me.
More information about the general
mailing list