Re: [PATCH rdma-next v1 06/10] IB/uverbs: Move QP, SRQ, WQ type and flags to UAPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 06, 2020 at 11:24:40AM +0300, Leon Romanovsky wrote:
> From: Yishai Hadas <yishaih@xxxxxxxxxxxx>
> 
> These constants are going to be used in the ioctl interface in coming
> patches so they are part of the UAPI, place them in the correct header
> for clarity.
> 
> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  include/rdma/ib_verbs.h                 | 43 ++++++++++++++-----------
>  include/uapi/rdma/ib_user_ioctl_verbs.h | 34 +++++++++++++++++++
>  2 files changed, 58 insertions(+), 19 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index b8b5b5310529..9cf2d9d05c06 100644
> +++ b/include/rdma/ib_verbs.h
> @@ -1012,9 +1012,9 @@ enum ib_cq_notify_flags {
>  };
>  
>  enum ib_srq_type {
> -	IB_SRQT_BASIC,
> -	IB_SRQT_XRC,
> -	IB_SRQT_TM,
> +	IB_SRQT_BASIC = IB_UVERBS_SRQT_BASIC,
> +	IB_SRQT_XRC = IB_UVERBS_SRQT_XRC,
> +	IB_SRQT_TM = IB_UVERBS_SRQT_TM,
>  };
>  
>  static inline bool ib_srq_has_cq(enum ib_srq_type srq_type)
> @@ -1083,16 +1083,16 @@ enum ib_qp_type {
>  	IB_QPT_SMI,
>  	IB_QPT_GSI,
>  
> -	IB_QPT_RC,
> -	IB_QPT_UC,
> -	IB_QPT_UD,
> +	IB_QPT_RC = IB_UVERBS_QPT_RC,
> +	IB_QPT_UC = IB_UVERBS_QPT_UC,
> +	IB_QPT_UD = IB_UVERBS_QPT_UD,
>  	IB_QPT_RAW_IPV6,
>  	IB_QPT_RAW_ETHERTYPE,
> -	IB_QPT_RAW_PACKET = 8,
> -	IB_QPT_XRC_INI = 9,
> -	IB_QPT_XRC_TGT,
> +	IB_QPT_RAW_PACKET = IB_UVERBS_QPT_RAW_PACKET,
> +	IB_QPT_XRC_INI = IB_UVERBS_QPT_XRC_INI,
> +	IB_QPT_XRC_TGT = IB_UVERBS_QPT_XRC_TGT,
>  	IB_QPT_MAX,
> -	IB_QPT_DRIVER = 0xFF,
> +	IB_QPT_DRIVER = IB_UVERBS_QPT_DRIVER,
>  	/* Reserve a range for qp types internal to the low level driver.
>  	 * These qp types will not be visible at the IB core layer, so the
>  	 * IB_QPT_MAX usages should not be affected in the core layer
> @@ -1111,17 +1111,21 @@ enum ib_qp_type {
>  
>  enum ib_qp_create_flags {
>  	IB_QP_CREATE_IPOIB_UD_LSO		= 1 << 0,
> -	IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK	= 1 << 1,
> +	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,
>  	/* FREE					= 1 << 7, */
> -	IB_QP_CREATE_SCATTER_FCS		= 1 << 8,
> -	IB_QP_CREATE_CVLAN_STRIPPING		= 1 << 9,
> +	IB_QP_CREATE_SCATTER_FCS		=
> +		IB_UVERBS_QP_CREATE_SCATTER_FCS,
> +	IB_QP_CREATE_CVLAN_STRIPPING		=
> +		IB_UVERBS_QP_CREATE_CVLAN_STRIPPING,
>  	IB_QP_CREATE_SOURCE_QPN			= 1 << 10,
> -	IB_QP_CREATE_PCI_WRITE_END_PADDING	= 1 << 11,
> +	IB_QP_CREATE_PCI_WRITE_END_PADDING	=
> +		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,
> @@ -1626,7 +1630,7 @@ enum ib_raw_packet_caps {
>  };
>  
>  enum ib_wq_type {
> -	IB_WQT_RQ
> +	IB_WQT_RQ = IB_UVERBS_WQT_RQ,
>  };
>  
>  enum ib_wq_state {
> @@ -1649,10 +1653,11 @@ struct ib_wq {
>  };
>  
>  enum ib_wq_flags {
> -	IB_WQ_FLAGS_CVLAN_STRIPPING	= 1 << 0,
> -	IB_WQ_FLAGS_SCATTER_FCS		= 1 << 1,
> -	IB_WQ_FLAGS_DELAY_DROP		= 1 << 2,
> -	IB_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3,
> +	IB_WQ_FLAGS_CVLAN_STRIPPING	= IB_UVERBS_WQ_FLAGS_CVLAN_STRIPPING,
> +	IB_WQ_FLAGS_SCATTER_FCS		= IB_UVERBS_WQ_FLAGS_SCATTER_FCS,
> +	IB_WQ_FLAGS_DELAY_DROP		= IB_UVERBS_WQ_FLAGS_DELAY_DROP,
> +	IB_WQ_FLAGS_PCI_WRITE_END_PADDING =
> +				IB_UVERBS_WQ_FLAGS_PCI_WRITE_END_PADDING,

For flags that are not used by kernel ULPs, like these, it makes more
sense to have the driver refer to the IB_UVERBS_* constant and remove
this stuff from the ULP facing header. Probably as individual patches

Same above from the create flags I suppose

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux