[PATCH] RDMA: Split kernel-only global device caps from uvers device caps

Jason Gunthorpe jgg at nvidia.com
Tue Apr 5 16:37:25 PDT 2022


On Tue, Apr 05, 2022 at 06:43:31AM +0200, Christoph Hellwig wrote:

> > -	if (!(device->attrs.device_cap_flags & IB_DEVICE_ALLOW_USER_UNREG)) {
> > +	if (!(device->attrs.kernel_cap_flags & IB_KDEVICE_ALLOW_USER_UNREG)) {
> 
> Maybe shorten the prefix to IBD_ ?

Sure
 
> > +enum ib_kernel_cap_flags {
> > +	/*
> > +	 * This device supports a per-device lkey or stag that can be
> > +	 * used without performing a memory registration for the local
> > +	 * memory.  Note that ULPs should never check this flag, but
> > +	 * instead of use the local_dma_lkey flag in the ib_pd structure,
> > +	 * which will always contain a usable lkey.
> > +	 */
> > +	IB_KDEVICE_LOCAL_DMA_LKEY = 1 << 0,
> > +	IB_KDEVICE_UD_TSO = 1 << 1,
> > +	IB_KDEVICE_BLOCK_MULTICAST_LOOPBACK = 1 << 2,
> > +	IB_KDEVICE_INTEGRITY_HANDOVER = 1 << 3,
> > +	IB_KDEVICE_ON_DEMAND_PAGING = 1ULL << 4,
> > +	IB_KDEVICE_SG_GAPS_REG = 1ULL << 5,
> > +	IB_KDEVICE_VIRTUAL_FUNCTION = 1ULL << 6,
> > +	IB_KDEVICE_RDMA_NETDEV_OPA = 1ULL << 7,
> > +	IB_KDEVICE_ALLOW_USER_UNREG = 1ULL << 8,
> > +};
> 
> And maybe not in this patch, but if you touch this anyway please add
> comments to document allthe flags.

Wouldn't that be nice.. I know what some of these do at least and can
try

The 'ULL' should go away too..

Jason



More information about the Linux-nvme mailing list