diff mbox series

[v3,1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi

Message ID 20220328154511.305319-1-yangx.jy@fujitsu.com (mailing list archive)
State Superseded
Headers show
Series [v3,1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi | expand

Commit Message

Xiao Yang March 28, 2022, 3:45 p.m. UTC
This enum is used by ibv_query_device_ex(3) so it should be defined
in include/uapi/rdma/ib_user_verbs.h.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 include/rdma/ib_verbs.h           | 19 ++++++++++++-------
 include/uapi/rdma/ib_user_verbs.h |  7 +++++++
 2 files changed, 19 insertions(+), 7 deletions(-)

Comments

Leon Romanovsky March 30, 2022, 11:12 a.m. UTC | #1
On Mon, Mar 28, 2022 at 11:45:10PM +0800, Xiao Yang wrote:
> This enum is used by ibv_query_device_ex(3) so it should be defined
> in include/uapi/rdma/ib_user_verbs.h.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  include/rdma/ib_verbs.h           | 19 ++++++++++++-------
>  include/uapi/rdma/ib_user_verbs.h |  7 +++++++
>  2 files changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 69d883f7fb41..e3ed65920558 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -1620,20 +1620,25 @@ struct ib_srq {
>  	struct rdma_restrack_entry res;
>  };
>  
> +/* This enum is shared with userspace */

This comment is not correct, because you are not using these values
directly in userspace. Your new ib_uverbs_raw_packet_caps is shared
and located in uapi folder.

>  enum ib_raw_packet_caps {
> -	/* Strip cvlan from incoming packet and report it in the matching work
> +	/*
> +	 * Strip cvlan from incoming packet and report it in the matching work
>  	 * completion is supported.
>  	 */
> -	IB_RAW_PACKET_CAP_CVLAN_STRIPPING	= (1 << 0),
> -	/* Scatter FCS field of an incoming packet to host memory is supported.
> +	IB_RAW_PACKET_CAP_CVLAN_STRIPPING =
> +		IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING,
> +	/*
> +	 * Scatter FCS field of an incoming packet to host memory is supported.
>  	 */
> -	IB_RAW_PACKET_CAP_SCATTER_FCS		= (1 << 1),
> +	IB_RAW_PACKET_CAP_SCATTER_FCS = IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS,
>  	/* Checksum offloads are supported (for both send and receive). */
> -	IB_RAW_PACKET_CAP_IP_CSUM		= (1 << 2),
> -	/* When a packet is received for an RQ with no receive WQEs, the
> +	IB_RAW_PACKET_CAP_IP_CSUM = IB_UVERBS_RAW_PACKET_CAP_IP_CSUM,
> +	/*
> +	 * When a packet is received for an RQ with no receive WQEs, the
>  	 * packet processing is delayed.
>  	 */
> -	IB_RAW_PACKET_CAP_DELAY_DROP		= (1 << 3),
> +	IB_RAW_PACKET_CAP_DELAY_DROP = IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP,
>  };
>  
>  enum ib_wq_type {
> diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
> index 7ee73a0652f1..ff549695f1ba 100644
> --- a/include/uapi/rdma/ib_user_verbs.h
> +++ b/include/uapi/rdma/ib_user_verbs.h
> @@ -1298,4 +1298,11 @@ struct ib_uverbs_ex_modify_cq {
>  
>  #define IB_DEVICE_NAME_MAX 64
>  
> +enum ib_uverbs_raw_packet_caps {
> +	IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
> +	IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
> +	IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
> +	IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
> +};
> +
>  #endif /* IB_USER_VERBS_H */
> -- 
> 2.34.1
> 
> 
>
Xiao Yang March 31, 2022, 3:26 a.m. UTC | #2
On 2022/3/30 19:12, Leon Romanovsky wrote:
> On Mon, Mar 28, 2022 at 11:45:10PM +0800, Xiao Yang wrote:
>> This enum is used by ibv_query_device_ex(3) so it should be defined
>> in include/uapi/rdma/ib_user_verbs.h.
>>
>> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
>> ---
>>   include/rdma/ib_verbs.h           | 19 ++++++++++++-------
>>   include/uapi/rdma/ib_user_verbs.h |  7 +++++++
>>   2 files changed, 19 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
>> index 69d883f7fb41..e3ed65920558 100644
>> --- a/include/rdma/ib_verbs.h
>> +++ b/include/rdma/ib_verbs.h
>> @@ -1620,20 +1620,25 @@ struct ib_srq {
>>   	struct rdma_restrack_entry res;
>>   };
>>   
>> +/* This enum is shared with userspace */
> This comment is not correct, because you are not using these values
> directly in userspace. Your new ib_uverbs_raw_packet_caps is shared
> and located in uapi folder.

Hi Leon,

Thanks for your suggestion, I will remove the comment directly in my v4 
patch.

Best Regards,

Xiao Yang

>>   enum ib_raw_packet_caps {
>> -	/* Strip cvlan from incoming packet and report it in the matching work
>> +	/*
>> +	 * Strip cvlan from incoming packet and report it in the matching work
>>   	 * completion is supported.
>>   	 */
>> -	IB_RAW_PACKET_CAP_CVLAN_STRIPPING	= (1 << 0),
>> -	/* Scatter FCS field of an incoming packet to host memory is supported.
>> +	IB_RAW_PACKET_CAP_CVLAN_STRIPPING =
>> +		IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING,
>> +	/*
>> +	 * Scatter FCS field of an incoming packet to host memory is supported.
>>   	 */
>> -	IB_RAW_PACKET_CAP_SCATTER_FCS		= (1 << 1),
>> +	IB_RAW_PACKET_CAP_SCATTER_FCS = IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS,
>>   	/* Checksum offloads are supported (for both send and receive). */
>> -	IB_RAW_PACKET_CAP_IP_CSUM		= (1 << 2),
>> -	/* When a packet is received for an RQ with no receive WQEs, the
>> +	IB_RAW_PACKET_CAP_IP_CSUM = IB_UVERBS_RAW_PACKET_CAP_IP_CSUM,
>> +	/*
>> +	 * When a packet is received for an RQ with no receive WQEs, the
>>   	 * packet processing is delayed.
>>   	 */
>> -	IB_RAW_PACKET_CAP_DELAY_DROP		= (1 << 3),
>> +	IB_RAW_PACKET_CAP_DELAY_DROP = IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP,
>>   };
>>   
>>   enum ib_wq_type {
>> diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
>> index 7ee73a0652f1..ff549695f1ba 100644
>> --- a/include/uapi/rdma/ib_user_verbs.h
>> +++ b/include/uapi/rdma/ib_user_verbs.h
>> @@ -1298,4 +1298,11 @@ struct ib_uverbs_ex_modify_cq {
>>   
>>   #define IB_DEVICE_NAME_MAX 64
>>   
>> +enum ib_uverbs_raw_packet_caps {
>> +	IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
>> +	IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
>> +	IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
>> +	IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
>> +};
>> +
>>   #endif /* IB_USER_VERBS_H */
>> -- 
>> 2.34.1
>>
>>
>>
diff mbox series

Patch

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 69d883f7fb41..e3ed65920558 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1620,20 +1620,25 @@  struct ib_srq {
 	struct rdma_restrack_entry res;
 };
 
+/* This enum is shared with userspace */
 enum ib_raw_packet_caps {
-	/* Strip cvlan from incoming packet and report it in the matching work
+	/*
+	 * Strip cvlan from incoming packet and report it in the matching work
 	 * completion is supported.
 	 */
-	IB_RAW_PACKET_CAP_CVLAN_STRIPPING	= (1 << 0),
-	/* Scatter FCS field of an incoming packet to host memory is supported.
+	IB_RAW_PACKET_CAP_CVLAN_STRIPPING =
+		IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING,
+	/*
+	 * Scatter FCS field of an incoming packet to host memory is supported.
 	 */
-	IB_RAW_PACKET_CAP_SCATTER_FCS		= (1 << 1),
+	IB_RAW_PACKET_CAP_SCATTER_FCS = IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS,
 	/* Checksum offloads are supported (for both send and receive). */
-	IB_RAW_PACKET_CAP_IP_CSUM		= (1 << 2),
-	/* When a packet is received for an RQ with no receive WQEs, the
+	IB_RAW_PACKET_CAP_IP_CSUM = IB_UVERBS_RAW_PACKET_CAP_IP_CSUM,
+	/*
+	 * When a packet is received for an RQ with no receive WQEs, the
 	 * packet processing is delayed.
 	 */
-	IB_RAW_PACKET_CAP_DELAY_DROP		= (1 << 3),
+	IB_RAW_PACKET_CAP_DELAY_DROP = IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP,
 };
 
 enum ib_wq_type {
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 7ee73a0652f1..ff549695f1ba 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -1298,4 +1298,11 @@  struct ib_uverbs_ex_modify_cq {
 
 #define IB_DEVICE_NAME_MAX 64
 
+enum ib_uverbs_raw_packet_caps {
+	IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
+	IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
+	IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
+	IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
+};
+
 #endif /* IB_USER_VERBS_H */