diff mbox

[5/9] ib_uverbs: Add padding to end align ib_uverbs_reg_mr_resp

Message ID 1472774969-18997-6-git-send-email-knut.omang@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Knut Omang Sept. 2, 2016, 12:09 a.m. UTC
The ib_uverbs_reg_mr_resp structure was not 64 bit end aligned
as required by the protocol. This causes alignment issues
if a device specific driver needs to transfer extra response
arguments.

Signed-off-by: Knut Omang <knut.omang@oracle.com>
---
 include/uapi/rdma/ib_user_verbs.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Jason Gunthorpe Sept. 2, 2016, 2:09 a.m. UTC | #1
On Fri, Sep 02, 2016 at 02:09:25AM +0200, Knut Omang wrote:
> The ib_uverbs_reg_mr_resp structure was not 64 bit end aligned
> as required by the protocol. This causes alignment issues
> if a device specific driver needs to transfer extra response
> arguments.

Can you explain in the commit message why this doesn't break anything?
How does compat work with existing libibverbs?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Knut Omang Sept. 2, 2016, 7:54 a.m. UTC | #2
On Thu, 2016-09-01 at 20:09 -0600, Jason Gunthorpe wrote:
> On Fri, Sep 02, 2016 at 02:09:25AM +0200, Knut Omang wrote:
> > 
> > The ib_uverbs_reg_mr_resp structure was not 64 bit end aligned
> > as required by the protocol. This causes alignment issues
> > if a device specific driver needs to transfer extra response
> > arguments.
> Can you explain in the commit message why this doesn't break anything?
> How does compat work with existing libibverbs?

It doesn't, and I realize I need to handle both

old userspace -> new kernel
new userspace -> old kernel

I am working on a fix for it, which would have to be in ib_uverbs due to the 

if  ( <user size> != <kernel size> ) 
   fail

semantics which effectively inhibits any changes at all  :-/

Thanks,
Knut

> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 7f035f4b..6b8c9c0 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -307,6 +307,7 @@  struct ib_uverbs_reg_mr_resp {
 	__u32 mr_handle;
 	__u32 lkey;
 	__u32 rkey;
+	__u32 reserved;
 };
 
 struct ib_uverbs_rereg_mr {