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

From: Christoph Hellwig <[email-masked]>
Date: Tue, 5 Apr 2022 06:43:31 +0200

On Mon, Apr 04, 2022 at 01:18:00PM -0300, Jason Gunthorpe wrote:
> Split ib_device::device_cap_flags into kernel_cap_flags that holds the
> flags only used by the kernel.
> 
> This cleanly splits out the uverbs flags from the kernel flags to avoid
> confusion in the flags bitmap.

> Followup from Xiao Yang's series

Can you point me to this series?

> -	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_ ?

> +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.