diff mbox

[4/6] IB/uapi: expose uverbs WC flags

Message ID 1450967967-12479-5-git-send-email-hch@lst.de (mailing list archive)
State Deferred
Headers show

Commit Message

Christoph Hellwig Dec. 24, 2015, 2:39 p.m. UTC
This exposes the WC flags supported by uverbs as part of the uapi
headers.  It follows the same scheme as the WR opcodes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/rdma/ib_verbs.h      | 14 +++++++-------
 include/uapi/rdma/ib_verbs.h | 10 ++++++++++
 2 files changed, 17 insertions(+), 7 deletions(-)

Comments

Leon Romanovsky Dec. 27, 2015, 6:15 a.m. UTC | #1
On Thu, Dec 24, 2015 at 03:39:25PM +0100, Christoph Hellwig wrote:
> This exposes the WC flags supported by uverbs as part of the uapi
> headers.  It follows the same scheme as the WR opcodes.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  include/rdma/ib_verbs.h      | 14 +++++++-------
>  include/uapi/rdma/ib_verbs.h | 10 ++++++++++
>  2 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 7dce204..337db70 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -835,13 +835,13 @@ enum ib_wc_opcode {
>  };
>  
>  enum ib_wc_flags {
> -	IB_WC_GRH		= 1,
> -	IB_WC_WITH_IMM		= (1<<1),
> -	IB_WC_WITH_INVALIDATE	= (1<<2),
> -	IB_WC_IP_CSUM_OK	= (1<<3),
> -	IB_WC_WITH_SMAC		= (1<<4),
> -	IB_WC_WITH_VLAN		= (1<<5),
> -	IB_WC_WITH_NETWORK_HDR_TYPE	= (1<<6),
> +	IB_WC_GRH			= IB_UVERBS_WC_GRH,
> +	IB_WC_WITH_IMM			= IB_UVERBS_WC_WITH_IMM,
> +	IB_WC_WITH_INVALIDATE		= IB_UVERBS_WC_WITH_INVALIDATE,
> +	IB_WC_IP_CSUM_OK		= IB_UVERBS_WC_IP_CSUM_OK,
> +	IB_WC_WITH_SMAC			= IB_UVERBS_WC_WITH_SMAC,
> +	IB_WC_WITH_VLAN			= IB_UVERBS_WC_WITH_VLAN,
> +	IB_WC_WITH_NETWORK_HDR_TYPE	= IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE,
>  };
>  
>  struct ib_wc {
> diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
> index fd7a393..c40c00b 100644
> --- a/include/uapi/rdma/ib_verbs.h
> +++ b/include/uapi/rdma/ib_verbs.h
> @@ -45,4 +45,14 @@ enum ib_uverbs_wc_opcode {
>  	IB_UVERBS_WC_RECV_END			= (1 << 7) + 1,
>  };
>  
> +enum ib_uverbs_wc_flags {
> +	IB_UVERBS_WC_GRH			= (1 << 0),
> +	IB_UVERBS_WC_WITH_IMM			= (1 << 1),
> +	IB_UVERBS_WC_WITH_INVALIDATE		= (1 << 2),
> +	IB_UVERBS_WC_IP_CSUM_OK			= (1 << 3),
> +	IB_UVERBS_WC_WITH_SMAC			= (1 << 4),
> +	IB_UVERBS_WC_WITH_VLAN			= (1 << 5),
> +	IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE	= (1 << 6),
> +};
It will be great to add _FLAGS_ mark in the name and add _LAST too.
> +
>  #endif /* _UAPI_RDMA_IB_VERBS_H */
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Dec. 29, 2015, 11:04 a.m. UTC | #2
>> +enum ib_uverbs_wc_flags {
>> +	IB_UVERBS_WC_GRH			= (1 << 0),
>> +	IB_UVERBS_WC_WITH_IMM			= (1 << 1),
>> +	IB_UVERBS_WC_WITH_INVALIDATE		= (1 << 2),
>> +	IB_UVERBS_WC_IP_CSUM_OK			= (1 << 3),
>> +	IB_UVERBS_WC_WITH_SMAC			= (1 << 4),
>> +	IB_UVERBS_WC_WITH_VLAN			= (1 << 5),
>> +	IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE	= (1 << 6),
>> +};
> It will be great to add _FLAGS_ mark in the name and add _LAST too.

Don't you prefer to stay consistent with the kernel enumeration?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 7dce204..337db70 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -835,13 +835,13 @@  enum ib_wc_opcode {
 };
 
 enum ib_wc_flags {
-	IB_WC_GRH		= 1,
-	IB_WC_WITH_IMM		= (1<<1),
-	IB_WC_WITH_INVALIDATE	= (1<<2),
-	IB_WC_IP_CSUM_OK	= (1<<3),
-	IB_WC_WITH_SMAC		= (1<<4),
-	IB_WC_WITH_VLAN		= (1<<5),
-	IB_WC_WITH_NETWORK_HDR_TYPE	= (1<<6),
+	IB_WC_GRH			= IB_UVERBS_WC_GRH,
+	IB_WC_WITH_IMM			= IB_UVERBS_WC_WITH_IMM,
+	IB_WC_WITH_INVALIDATE		= IB_UVERBS_WC_WITH_INVALIDATE,
+	IB_WC_IP_CSUM_OK		= IB_UVERBS_WC_IP_CSUM_OK,
+	IB_WC_WITH_SMAC			= IB_UVERBS_WC_WITH_SMAC,
+	IB_WC_WITH_VLAN			= IB_UVERBS_WC_WITH_VLAN,
+	IB_WC_WITH_NETWORK_HDR_TYPE	= IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE,
 };
 
 struct ib_wc {
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
index fd7a393..c40c00b 100644
--- a/include/uapi/rdma/ib_verbs.h
+++ b/include/uapi/rdma/ib_verbs.h
@@ -45,4 +45,14 @@  enum ib_uverbs_wc_opcode {
 	IB_UVERBS_WC_RECV_END			= (1 << 7) + 1,
 };
 
+enum ib_uverbs_wc_flags {
+	IB_UVERBS_WC_GRH			= (1 << 0),
+	IB_UVERBS_WC_WITH_IMM			= (1 << 1),
+	IB_UVERBS_WC_WITH_INVALIDATE		= (1 << 2),
+	IB_UVERBS_WC_IP_CSUM_OK			= (1 << 3),
+	IB_UVERBS_WC_WITH_SMAC			= (1 << 4),
+	IB_UVERBS_WC_WITH_VLAN			= (1 << 5),
+	IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE	= (1 << 6),
+};
+
 #endif /* _UAPI_RDMA_IB_VERBS_H */