Re: [PATCH 1/9] RDMA/uverbs: Store the specs_root in the struct ib_uverbs_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 26, 2018 at 03:10:03PM +0000, Ruhl, Michael J wrote:
> >From: Jason Gunthorpe [mailto:jgg@xxxxxxxx]
> >Sent: Monday, June 25, 2018 6:13 PM
> >To: linux-rdma@xxxxxxxxxxxxxxx
> >Cc: Ruhl, Michael J <michael.j.ruhl@xxxxxxxxx>; Leon Romanovsky
> ><leonro@xxxxxxxxxxxx>; Guy Levi <guyle@xxxxxxxxxxxx>; Jason
> >Gunthorpe <jgg@xxxxxxxxxxxx>
> >Subject: [PATCH 1/9] RDMA/uverbs: Store the specs_root in the struct
> >ib_uverbs_device
> >
> >From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >
> >The specs are required to operate the uverbs file, so they belong inside
> >the ib_uverbs_device, not inside the ib_device. The spec passed in the
> >ib_device is just a communication from the driver and should not be used
> >during runtime.
> >
> >This also changes the lifetime of the spec memory to match the
> >ib_uverbs_device, however at this time the spec_root can still contain
> >driver pointers after disassociation, so it cannot be used if ib_dev is
> >NULL. This is preparation for another series.
> >
> >Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> > drivers/infiniband/core/rdma_core.c    |  4 ++--
> > drivers/infiniband/core/rdma_core.h    |  2 +-
> > drivers/infiniband/core/uverbs_ioctl.c | 26 ++++++++++++--------------
> > drivers/infiniband/core/uverbs_main.c  | 16 +++++++++-------
> > drivers/infiniband/hw/mlx5/main.c      |  6 +++---
> > include/rdma/ib_verbs.h                |  2 +-
> > 6 files changed, 28 insertions(+), 28 deletions(-)
> >
> >diff --git a/drivers/infiniband/core/rdma_core.c
> >b/drivers/infiniband/core/rdma_core.c
> >index df3c405332525a..35ab553568e748 100644
> >+++ b/drivers/infiniband/core/rdma_core.c
> >@@ -52,10 +52,10 @@ int uverbs_ns_idx(u16 *id, unsigned int ns_count)
> > 	return ret;
> > }
> >
> >-const struct uverbs_object_spec *uverbs_get_object(const struct ib_device
> >*ibdev,
> >+const struct uverbs_object_spec *uverbs_get_object(struct ib_uverbs_file
> >*ufile,
> > 						   uint16_t object)
> > {
> >-	const struct uverbs_root_spec *object_hash = ibdev->specs_root;
> >+	const struct uverbs_root_spec *object_hash = ufile->device-
> >>specs_root;
> > 	const struct uverbs_object_spec_hash *objects;
> > 	int ret = uverbs_ns_idx(&object, object_hash->num_buckets);
> >
> >diff --git a/drivers/infiniband/core/rdma_core.h
> >b/drivers/infiniband/core/rdma_core.h
> >index a243cc2a59f76d..b8943f47caba84 100644
> >+++ b/drivers/infiniband/core/rdma_core.h
> >@@ -44,7 +44,7 @@
> > #include <linux/mutex.h>
> >
> > int uverbs_ns_idx(u16 *id, unsigned int ns_count);
> >-const struct uverbs_object_spec *uverbs_get_object(const struct ib_device
> >*ibdev,
> >+const struct uverbs_object_spec *uverbs_get_object(struct ib_uverbs_file
> >*ibdev,
>      ^^^^^
> s/ibdev/ufile?

Ah, yes, got it.

> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx>

Thanks

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux