diff mbox series

[for-next,v1,1/4] RDMA/uverbs: initialize uverbs_attr_bundle ucontext in ib_uverbs_get_context

Message ID 20190430142333.31063-2-shamir.rabinovitch@oracle.com (mailing list archive)
State Superseded
Delegated to: Jason Gunthorpe
Headers show
Series ib_pd should not have ib_uobject | expand

Commit Message

Shamir Rabinovitch April 30, 2019, 2:23 p.m. UTC
ib_uverbs_get_context does not have uobject so it does not call the
rdma_lookup_get_uobject which is used to set up the uverbs_attr_bundle
ucontext. for ib_uverbs_get_context we need to set up this manually
before we send the uverbs_attr_bundle down to the driver layer.

this complete the change that was done in
("70f06b26f07e IB: ucontext should be set properly for all cmd & ioctl paths")

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
---
 drivers/infiniband/core/uverbs_cmd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jason Gunthorpe May 3, 2019, 10:49 p.m. UTC | #1
On Tue, Apr 30, 2019 at 05:23:21PM +0300, Shamir Rabinovitch wrote:
> ib_uverbs_get_context does not have uobject so it does not call the
> rdma_lookup_get_uobject which is used to set up the uverbs_attr_bundle
> ucontext. for ib_uverbs_get_context we need to set up this manually
> before we send the uverbs_attr_bundle down to the driver layer.
> 
> this complete the change that was done in
> ("70f06b26f07e IB: ucontext should be set properly for all cmd & ioctl paths")
> 
> Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
> ---
>  drivers/infiniband/core/uverbs_cmd.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied to for-next

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 04d08135b374..76ac113d1da5 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -230,6 +230,8 @@  static int ib_uverbs_get_context(struct uverbs_attr_bundle *attrs)
 		goto err_alloc;
 	}
 
+	attrs->context = ucontext;
+
 	ucontext->res.type = RDMA_RESTRACK_CTX;
 	ucontext->device = ib_dev;
 	ucontext->cg_obj = cg_obj;