Re: [PATCH net-next v5] RDMA: Change capability fields in ib_device_attr from int to u32
Erni Sri Satya Vennela <[email protected]> Mon, 1 Jun 2026 02:23:45 -0700
| Newsgroups | gmane.linux.drivers.rdma,gmane.linux.kernel,gmane.linux.scsi.target.devel,gmane.linux.kernel.cifs,gmane.network.samba.internals,gmane.linux.nfs,gmane.linux.network |
|---|---|
| Message-ID | <ah1PoREU8DSqYHxj@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> |
On Mon, Jun 01, 2026 at 02:14:44AM -0700, Erni Sri Satya Vennela wrote: > The capability counter fields in struct ib_device_attr are declared > as signed int, but these values are inherently non-negative. Drivers > maintain their cached caps as u32 and assign them directly into these > int fields; if a cap exceeds INT_MAX the implicit narrowing yields a > negative value visible to the IB core. > > Change the signed int capability fields to u32 to match the > underlying nature of the data. Also update consumers across the IB > core, ULPs, NVMe-oF target, RDS, and NFS/RDMA so the new u32 values > are not forced back through signed int or u8 via min()/min_t() or > narrowing local variables. > > Suggested-by: Jason Gunthorpe <[email protected]> > Signed-off-by: Erni Sri Satya Vennela <[email protected]> > --- Sorry for the incorrect prefix in v5 (used net-next instead of rdma-next). Please considerthe next version v6. Thanks, Vennela