RE: [PATCH rdma-next 2/7] RDMA/providers: Simplify query_gid callback of RoCE providers

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

 




> -----Original Message-----
> From: Jason Gunthorpe [mailto:jgg@xxxxxxxx]
> Sent: Thursday, March 29, 2018 5:00 PM
> To: Leon Romanovsky <leon@xxxxxxxxxx>
> Cc: Doug Ledford <dledford@xxxxxxxxxx>; Leon Romanovsky
> <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>;
> Mark Bloch <markb@xxxxxxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx>
> Subject: Re: [PATCH rdma-next 2/7] RDMA/providers: Simplify query_gid
> callback of RoCE providers
> 
> On Wed, Mar 28, 2018 at 03:43:39PM +0300, Leon Romanovsky wrote:
> > From: Parav Pandit <parav@xxxxxxxxxxxx>
> >
> > ib_query_gid() fetches the GID from the software cache maintained in
> > ib_core for RoCE ports.
> > Therefore, simplify the provider drivers for RoCE to treat query_gid()
> > callback as no-op.
> >
> > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > ---
> >  drivers/infiniband/hw/mlx4/main.c           | 17 +----------------
> >  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 14 +-------------
> >  drivers/infiniband/hw/qedr/verbs.c          | 17 +----------------
> >  drivers/infiniband/sw/rxe/rxe_verbs.c       | 13 +------------
> >  4 files changed, 4 insertions(+), 57 deletions(-)
> >
> >  static int mlx4_ib_query_sl2vl(struct ib_device *ibdev, u8 port, u64
> > *sl2vl_tbl) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> > b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> > index 1e3dc92bc37b..5e503b0cdad6 100644
> > --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> > @@ -65,19 +65,7 @@ int ocrdma_query_pkey(struct ib_device *ibdev, u8
> > port, u16 index, u16 *pkey)  int ocrdma_query_gid(struct ib_device *ibdev, u8
> port,
> >  		     int index, union ib_gid *sgid)  {
> > -	int ret;
> > -
> > -	memset(sgid, 0, sizeof(*sgid));
> > -	if (index >= OCRDMA_MAX_SGID)
> > -		return -EINVAL;
> > -
> > -	ret = ib_get_cached_gid(ibdev, port, index, sgid, NULL);
> > -	if (ret == -EAGAIN) {
> > -		memcpy(sgid, &zgid, sizeof(*sgid));
> > -		return 0;
> > -	}
> > -
> > -	return ret;
> > +	return 0;
> >  }
> 
> I like this patch, but instead of leaving dummy return 0' functions in the driver
> can you delete them and do this instead:
> 
> @@ -884,6 +884,9 @@ int ib_query_gid(struct ib_device *device,
>         if (attr)
>                 return -EINVAL;
> 
> +       if (!device->query_gid)
> +               return -EOPNOTSUPP;
> +
Yes. This is doable for RoCE only drivers. Others dual personality drivers will continue to report query_gid callback and return 0 when appropriate.

>         return device->query_gid(device, port_num, index, gid);  }
> EXPORT_SYMBOL(ib_query_gid);
> 
> ??
> 
> 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