Re: [PATCH rdma-next 03/10] RDMA/uverbs: Replace ib_uverbs_file with uverbs_attr_bundle for write

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

 



On Tue, Nov 20, 2018 at 03:47:38PM +0000, Ruhl, Michael J wrote:
> >From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma-
> >owner@xxxxxxxxxxxxxxx] On Behalf Of Leon Romanovsky
> >Sent: Monday, November 19, 2018 3:11 AM
> >To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe
> ><jgg@xxxxxxxxxxxx>
> >Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux-
> >rdma@xxxxxxxxxxxxxxx>
> >Subject: [PATCH rdma-next 03/10] RDMA/uverbs: Replace ib_uverbs_file with
> >uverbs_attr_bundle for write
> >
> >From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >
> >Now that we can add meta-data to the description of write() methods we
> >need to pass the uverbs_attr_bundle into all write based handlers so
> >future patches can use it as a container for any new data transferred out
> >of the core.
> >
> >This is the first step to bringing the write() and ioctl() methods to a
> >common interface signature.
> >
> >This is a simple search/replace, and we push the attr down into the uobj
> >and other APIs to keep changes minimal.
> >
> >Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > drivers/infiniband/core/rdma_core.c   |  13 +-
> > drivers/infiniband/core/rdma_core.h   |   8 +-
> > drivers/infiniband/core/uverbs_cmd.c  | 301 +++++++++++++-------------
> > drivers/infiniband/core/uverbs_main.c |  12 +-
> > drivers/infiniband/core/uverbs_uapi.c |   4 +-
> > drivers/infiniband/hw/mlx5/devx.c     |   2 +-
> > include/rdma/ib_verbs.h               |   2 +-
> > include/rdma/uverbs_ioctl.h           |  10 +-
> > include/rdma/uverbs_std_types.h       |  48 ++--
> > 9 files changed, 208 insertions(+), 192 deletions(-)
> >
> >diff --git a/drivers/infiniband/core/rdma_core.c
> >b/drivers/infiniband/core/rdma_core.c
> >index 752a55c6bdce..cf671a643d4c 100644
> >+++ b/drivers/infiniband/core/rdma_core.c
> >@@ -224,12 +224,14 @@ int uobj_destroy(struct ib_uobject *uobj)
> >  * uverbs_put_destroy.
> >  */
> > struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
> >-				      u32 id, struct ib_uverbs_file *ufile)
> >+				      u32 id,
> >+				      const struct uverbs_attr_bundle *attrs)
> > {
> > 	struct ib_uobject *uobj;
> > 	int ret;
> >
> >-	uobj = rdma_lookup_get_uobject(obj, ufile, id,
> >UVERBS_LOOKUP_DESTROY);
> >+	uobj = rdma_lookup_get_uobject(obj, attrs->ufile, id,
> >+				       UVERBS_LOOKUP_DESTROY);
> 
> Is there a reason that you didn't push attrs into rdma_lookup_get_uobject()?

Not really.. In this case only uobj_* is being called from the write()
handlers so I stopped pushing at that layer. It makes some sense that
the rdma_* layer is more general than the uobj_* layer, but it could
also be argued the other way.

There are a lot of places where attr_bundle should be pushed down
into, particularly into drivers. I was expecting all of that to be its
own series. This thing is already very big.

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

Thanks

Jason




[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