Re: [PATCH rdma-next v9] RDMA: Change capability fields in ib_device_attr from int to u32

Leon Romanovsky <[email protected]>
Newsgroups gmane.linux.scsi.target.devel,gmane.linux.drivers.rdma,gmane.linux.kernel,gmane.linux.kernel.cifs,gmane.network.samba.internals,gmane.linux.nfs,gmane.linux.network
Message-ID <20260707102546.GM15188@unreal>
On Tue, Jul 07, 2026 at 03:20:36AM -0700, Erni Sri Satya Vennela wrote:
> On Mon, Jul 06, 2026 at 11:49:50AM +0300, Leon Romanovsky wrote:
> > > ---
> > >  drivers/infiniband/core/cq.c               |  3 +-
> > >  drivers/infiniband/hw/qedr/verbs.c         |  2 +-
> > >  drivers/infiniband/sw/rxe/rxe_qp.c         | 22 +++++-----
> > >  drivers/infiniband/sw/rxe/rxe_srq.c        | 16 +++----
> > >  drivers/infiniband/ulp/ipoib/ipoib_cm.c    | 10 ++---
> > >  drivers/infiniband/ulp/ipoib/ipoib_verbs.c |  3 +-
> > >  drivers/infiniband/ulp/iser/iser_verbs.c   |  5 +--
> > >  drivers/infiniband/ulp/isert/ib_isert.c    |  7 ++-
> > >  drivers/infiniband/ulp/rtrs/rtrs-clt.c     | 11 ++---
> > >  drivers/infiniband/ulp/rtrs/rtrs-srv.c     | 11 ++---
> > >  drivers/infiniband/ulp/srp/ib_srp.c        |  2 +-
> > >  drivers/infiniband/ulp/srpt/ib_srpt.c      | 21 +++++----
> > >  drivers/nvme/host/rdma.c                   |  8 ++--
> > >  drivers/nvme/target/rdma.c                 | 22 ++++++----
> > >  fs/smb/smbdirect/accept.c                  |  5 ++-
> > >  fs/smb/smbdirect/connect.c                 |  5 ++-
> > >  fs/smb/smbdirect/connection.c              |  8 ++--
> > >  include/linux/sunrpc/svc_rdma.h            |  4 +-
> > >  include/rdma/ib_verbs.h                    | 50 +++++++++++-----------
> > >  net/rds/ib.c                               | 10 ++---
> > >  net/rds/ib_cm.c                            | 10 ++---
> > >  net/sunrpc/xprtrdma/frwr_ops.c             |  7 +--
> > >  net/sunrpc/xprtrdma/svc_rdma_transport.c   |  5 +--
> > >  net/sunrpc/xprtrdma/verbs.c                |  2 +-
> > >  24 files changed, 122 insertions(+), 127 deletions(-)
> > 
> > The following code is still missing. 
> 
> I'll make this change in the next version.
> 
> >Also, what about mxa_srq?
> > Why wasn't it converted as well?
> 
> I originally left max_srq as int because its only consumer pairs it with
> num_comp_vectors (a signed int) in nvmet_rdma, so keeping it int let
> that site stay a plain min() instead of a min_t().
> 
> num_comp_vectors is the completion-vector count, legitimately int and
> never anywhere near INT_MAX, so I'd prefer to leave it signed rather
> than convert it everywhere. Does that work for you, or would you rather
> num_comp_vectors be converted too?

In this patch no, but it is worth to write this in commit message.

Thanks

> 
> If it needs converting, I'll do it as a separate patch, since it lives
> in a different struct (ib_device) and touches many call sites.
> Otherwise, using min_t() for just this one call is fine too.
> 
> Thanks,
> Vennela
> 
> > 
> > diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
> > index f599c24b34e8..aae4f3f6bcba 100644
> > --- a/drivers/infiniband/core/nldev.c
> > +++ b/drivers/infiniband/core/nldev.c
> > @@ -454,7 +454,8 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device,
> >         };
> > 
> >         struct nlattr *table_attr;
> > -       int ret, i, curr, max;
> > +       u64 curr, max;
> > +       int ret, i;
> > 
> >         if (fill_nldev_handle(msg, device))
> >                 return -EMSGSIZE;
> > diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
> > index cfee2071586c..1b2f9df49e28 100644
> > --- a/drivers/infiniband/core/restrack.c
> > +++ b/drivers/infiniband/core/restrack.c
> > @@ -61,7 +61,7 @@ void rdma_restrack_clean(struct ib_device *dev)
> >   * @type: actual type of object to operate
> >   * @show_details: count driver specific objects
> >   */
> > -int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
> > +u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
> >                         bool show_details)
> >  {
> >         struct rdma_restrack_root *rt = &dev->res[type];
> > diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
> > index 451f99e3717d..c081384740ce 100644
> > --- a/include/rdma/restrack.h
> > +++ b/include/rdma/restrack.h
> > @@ -123,7 +123,7 @@ struct rdma_restrack_entry {
> >         u32 id;
> >  };
> > 
> > -int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
> > +u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
> >                         bool show_details);
> >  /**
> >   * rdma_is_kernel_res() - check the owner of resource
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.