Subject: Re: [PATCH rdma-next 03/13] RDMA: Split kernel-only create QP flags from uverbs create QP flags

From: Jason Gunthorpe <[email-masked]>
Date: Mon, 16 Jan 2023 13:39:38 -0400

On Mon, Jan 16, 2023 at 03:05:50PM +0200, Leon Romanovsky wrote:

> diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
> index 17fee1e73a45..c553bf0eb257 100644
> --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
> +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
> @@ -184,7 +184,7 @@ enum mlx4_ib_qp_flags {
>  	/* Mellanox specific flags start from IB_QP_CREATE_RESERVED_START */
>  	MLX4_IB_ROCE_V2_GSI_QP = MLX4_IB_QP_CREATE_ROCE_V2_GSI,
>  	MLX4_IB_SRIOV_TUNNEL_QP = 1 << 30,
> -	MLX4_IB_SRIOV_SQP = 1 << 31,
> +	MLX4_IB_SRIOV_SQP = 1ULL << 31,
>  };

These should be moved to a uapi if we are saying they are userspace
available

But I'm not sure they are?

> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 949cf4ffc536..cc2ddd4e6c12 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -1140,16 +1140,15 @@ enum ib_qp_type {
>  	IB_QPT_RESERVED10,
>  };
>  
> +/*
> + * bits 0, 5, 6 and 7 may be set by old kernels and should not be used.
> + */

This is backwards "bits 0 5 6 7 were understood by older kernels and
should not be used"

>  enum ib_qp_create_flags {
> -	IB_QP_CREATE_IPOIB_UD_LSO		= 1 << 0,
>  	IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK	=
>  		IB_UVERBS_QP_CREATE_BLOCK_MULTICAST_LOOPBACK,
>  	IB_QP_CREATE_CROSS_CHANNEL              = 1 << 2,
>  	IB_QP_CREATE_MANAGED_SEND               = 1 << 3,
>  	IB_QP_CREATE_MANAGED_RECV               = 1 << 4,
> -	IB_QP_CREATE_NETIF_QP			= 1 << 5,
> -	IB_QP_CREATE_INTEGRITY_EN		= 1 << 6,
> -	IB_QP_CREATE_NETDEV_USE			= 1 << 7,
>  	IB_QP_CREATE_SCATTER_FCS		=
>  		IB_UVERBS_QP_CREATE_SCATTER_FCS,
>  	IB_QP_CREATE_CVLAN_STRIPPING		=
> @@ -1159,7 +1158,18 @@ enum ib_qp_create_flags {
>  		IB_UVERBS_QP_CREATE_PCI_WRITE_END_PADDING,
>  	/* reserve bits 26-31 for low level drivers' internal use */
>  	IB_QP_CREATE_RESERVED_START		= 1 << 26,
> -	IB_QP_CREATE_RESERVED_END		= 1 << 31,
> +	IB_QP_CREATE_RESERVED_END		= 1ULL << 31,

And these should be shifted to the uapi header

Jason