linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* start moving user space visible constants to uapi headers
@ 2015-12-24 14:39 Christoph Hellwig
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Currently very little of the uverbs user interface is actually exposed in
uapi headers, and it's a constant struggle to figure out what's kernel
internal and what is actually exposed in public.  This series starts
sorting this out by creating the infrastructure for a uapi header shared
between uverbs and the core IB stack, and starts moving all WR and WC
constants as well as the device capabilitity flags there.

A lot more work will have to follow, and I hope others will help out as
well.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] IB/uapi: expose uverbs WR opcodes
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-2-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 2/6] IB/uapi: expose uverbs send WR flags Christoph Hellwig
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

This exposes the WR opcodes supported by uverbs as part of the uapi
headers. For this I had to create a new uapi/rdma/ib_verbs.h headers
so that we don't have to drag ib_user_verbs.h into the main ib_verbs.h.

There are now three tiers of WR opcodes: uapi ones that are fixeѕ and
must not change [1], kernel-wide ones that follow the uapi ones
and can be reordered at will, and driver-private ones that follow the
kernel-wide ones, and will also be frequently reordered.

[1] we also assign explicitly values to them just so that this is obvious!

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/mlx5_ib.h |  2 +-
 include/rdma/ib_verbs.h              | 39 ++++++++++++++++--------------------
 include/uapi/rdma/ib_user_verbs.h    |  2 ++
 include/uapi/rdma/ib_verbs.h         | 23 +++++++++++++++++++++
 4 files changed, 43 insertions(+), 23 deletions(-)
 create mode 100644 include/uapi/rdma/ib_verbs.h

diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index d4b2271..2f82a08 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -122,7 +122,7 @@ struct mlx5_ib_pd {
 #define MLX5_IB_SEND_UMR_FAIL_IF_FREE (IB_SEND_RESERVED_START << 1)
 #define MLX5_IB_SEND_UMR_UPDATE_MTT (IB_SEND_RESERVED_START << 2)
 #define MLX5_IB_QPT_REG_UMR	IB_QPT_RESERVED1
-#define MLX5_IB_WR_UMR		IB_WR_RESERVED1
+#define MLX5_IB_WR_UMR		(IB_WR_END + 0)
 
 struct wr_list {
 	u16	opcode;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 75fcc97..94509e0 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -60,6 +60,8 @@
 #include <linux/mmu_notifier.h>
 #include <asm/uaccess.h>
 
+#include <uapi/rdma/ib_verbs.h>
+
 extern struct workqueue_struct *ib_wq;
 extern struct workqueue_struct *ib_comp_wq;
 
@@ -1108,34 +1110,27 @@ struct ib_qp_attr {
 };
 
 enum ib_wr_opcode {
-	IB_WR_RDMA_WRITE,
-	IB_WR_RDMA_WRITE_WITH_IMM,
-	IB_WR_SEND,
-	IB_WR_SEND_WITH_IMM,
-	IB_WR_RDMA_READ,
-	IB_WR_ATOMIC_CMP_AND_SWP,
-	IB_WR_ATOMIC_FETCH_AND_ADD,
-	IB_WR_LSO,
-	IB_WR_SEND_WITH_INV,
+	/* opcodes directly passed through from userspace: */
+	IB_WR_RDMA_WRITE		= IB_UVERBS_WR_RDMA_WRITE,
+	IB_WR_RDMA_WRITE_WITH_IMM	= IB_UVERBS_WR_RDMA_WRITE_WITH_IMM,
+	IB_WR_SEND			= IB_UVERBS_WR_SEND,
+	IB_WR_SEND_WITH_IMM		= IB_UVERBS_WR_SEND_WITH_IMM,
+	IB_WR_RDMA_READ			= IB_UVERBS_WR_RDMA_READ,
+	IB_WR_ATOMIC_CMP_AND_SWP	= IB_UVERBS_WR_ATOMIC_CMP_AND_SWP,
+	IB_WR_ATOMIC_FETCH_AND_ADD	= IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD,
+	IB_WR_SEND_WITH_INV		= IB_UVERBS_WR_SEND_WITH_INV,
+
+	/* kernel-internal opcodes: */
+	IB_WR_LSO			= IB_UVERBS_WR_END,
 	IB_WR_RDMA_READ_WITH_INV,
 	IB_WR_LOCAL_INV,
 	IB_WR_REG_MR,
 	IB_WR_MASKED_ATOMIC_CMP_AND_SWP,
 	IB_WR_MASKED_ATOMIC_FETCH_AND_ADD,
 	IB_WR_REG_SIG_MR,
-	/* reserve values for low level drivers' internal use.
-	 * These values will not be used at all in the ib core layer.
-	 */
-	IB_WR_RESERVED1 = 0xf0,
-	IB_WR_RESERVED2,
-	IB_WR_RESERVED3,
-	IB_WR_RESERVED4,
-	IB_WR_RESERVED5,
-	IB_WR_RESERVED6,
-	IB_WR_RESERVED7,
-	IB_WR_RESERVED8,
-	IB_WR_RESERVED9,
-	IB_WR_RESERVED10,
+
+	/* drivers may use any value greater or equal to IB_WR_END internally */
+	IB_WR_END,
 };
 
 enum ib_send_flags {
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 8126c14..358a656 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -38,6 +38,8 @@
 
 #include <linux/types.h>
 
+#include <uapi/rdma/ib_verbs.h>
+
 /*
  * Increment this value if any changes that break userspace ABI
  * compatibility are made.
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
new file mode 100644
index 0000000..330175e
--- /dev/null
+++ b/include/uapi/rdma/ib_verbs.h
@@ -0,0 +1,23 @@
+#ifndef _UAPI_RDMA_IB_VERBS_H
+#define _UAPI_RDMA_IB_VERBS_H 1
+
+/*
+ * This file contains constants exposed through the uverbs ABI that are also
+ * used internall by the RDMA stack.  It is separte from ib_user_verbs.h to
+ * having to pull that into the kernel-internal internal ib_verbs.h
+ */
+
+enum ib_uverbs_wr_opcode {
+	IB_UVERBS_WR_RDMA_WRITE			= 0,
+	IB_UVERBS_WR_RDMA_WRITE_WITH_IMM	= 1,
+	IB_UVERBS_WR_SEND			= 2,
+	IB_UVERBS_WR_SEND_WITH_IMM		= 3,
+	IB_UVERBS_WR_RDMA_READ			= 4,
+	IB_UVERBS_WR_ATOMIC_CMP_AND_SWP		= 5,
+	IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD	= 6,
+	/* 7 is still available */
+	IB_UVERBS_WR_SEND_WITH_INV		= 8,
+	IB_UVERBS_WR_END			= 9,
+};
+
+#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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/6] IB/uapi: expose uverbs send WR flags
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 1/6] IB/uapi: expose uverbs WR opcodes Christoph Hellwig
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-3-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 3/6] IB/uapi: expose uverbs WC opcodes Christoph Hellwig
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

This exposes the send WR 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-jcswGhMUV9g@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/mlx5_ib.h |  6 +++---
 include/rdma/ib_verbs.h              | 14 ++++++--------
 include/uapi/rdma/ib_verbs.h         |  9 +++++++++
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 2f82a08..6c264f0 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -118,9 +118,9 @@ struct mlx5_ib_pd {
  * enum ib_send_flags and enum ib_qp_type for low-level driver
  */
 
-#define MLX5_IB_SEND_UMR_UNREG	IB_SEND_RESERVED_START
-#define MLX5_IB_SEND_UMR_FAIL_IF_FREE (IB_SEND_RESERVED_START << 1)
-#define MLX5_IB_SEND_UMR_UPDATE_MTT (IB_SEND_RESERVED_START << 2)
+#define MLX5_IB_SEND_UMR_UNREG	IB_SEND_END
+#define MLX5_IB_SEND_UMR_FAIL_IF_FREE (IB_SEND_END << 1)
+#define MLX5_IB_SEND_UMR_UPDATE_MTT (IB_SEND_END << 2)
 #define MLX5_IB_QPT_REG_UMR	IB_QPT_RESERVED1
 #define MLX5_IB_WR_UMR		(IB_WR_END + 0)
 
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 94509e0..5dccc6a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1134,15 +1134,13 @@ enum ib_wr_opcode {
 };
 
 enum ib_send_flags {
-	IB_SEND_FENCE		= 1,
-	IB_SEND_SIGNALED	= (1<<1),
-	IB_SEND_SOLICITED	= (1<<2),
-	IB_SEND_INLINE		= (1<<3),
-	IB_SEND_IP_CSUM		= (1<<4),
+	IB_SEND_FENCE		= IB_UVERBS_SEND_FENCE,
+	IB_SEND_SIGNALED	= IB_UVERBS_SEND_SIGNALED,
+	IB_SEND_SOLICITED	= IB_UVERBS_SEND_SOLICITED,
+	IB_SEND_INLINE		= IB_UVERBS_SEND_INLINE,
+	IB_SEND_IP_CSUM		= IB_UVERBS_SEND_IP_CSUM,
 
-	/* reserve bits 26-31 for low level drivers' internal use */
-	IB_SEND_RESERVED_START	= (1 << 26),
-	IB_SEND_RESERVED_END	= (1 << 31),
+	IB_SEND_END		= IB_UVERBS_SEND_END,
 };
 
 struct ib_sge {
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
index 330175e..3be3152 100644
--- a/include/uapi/rdma/ib_verbs.h
+++ b/include/uapi/rdma/ib_verbs.h
@@ -20,4 +20,13 @@ enum ib_uverbs_wr_opcode {
 	IB_UVERBS_WR_END			= 9,
 };
 
+enum ib_uverbs_send_flags {
+	IB_UVERBS_SEND_FENCE			= (1 << 0),
+	IB_UVERBS_SEND_SIGNALED			= (1 << 1),
+	IB_UVERBS_SEND_SOLICITED		= (1 << 2),
+	IB_UVERBS_SEND_INLINE			= (1 << 3),
+	IB_UVERBS_SEND_IP_CSUM			= (1 << 4),
+	IB_UVERBS_SEND_END			= (1 << 5),
+};
+
 #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/6] IB/uapi: expose uverbs WC opcodes
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 1/6] IB/uapi: expose uverbs WR opcodes Christoph Hellwig
  2015-12-24 14:39   ` [PATCH 2/6] IB/uapi: expose uverbs send WR flags Christoph Hellwig
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-4-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 4/6] IB/uapi: expose uverbs WC flags Christoph Hellwig
                     ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

This exposes the WC opcodes supported by uverbs as part of the uapi
headers.  It follows the same scheme as the WR opcodes.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 include/rdma/ib_verbs.h      | 29 +++++++++++++----------------
 include/uapi/rdma/ib_verbs.h | 16 ++++++++++++++++
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 5dccc6a..7dce204 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -819,22 +819,19 @@ enum ib_wc_status {
 const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
 
 enum ib_wc_opcode {
-	IB_WC_SEND,
-	IB_WC_RDMA_WRITE,
-	IB_WC_RDMA_READ,
-	IB_WC_COMP_SWAP,
-	IB_WC_FETCH_ADD,
-	IB_WC_LSO,
-	IB_WC_LOCAL_INV,
-	IB_WC_REG_MR,
-	IB_WC_MASKED_COMP_SWAP,
-	IB_WC_MASKED_FETCH_ADD,
-/*
- * Set value of IB_WC_RECV so consumers can test if a completion is a
- * receive by testing (opcode & IB_WC_RECV).
- */
-	IB_WC_RECV			= 1 << 7,
-	IB_WC_RECV_RDMA_WITH_IMM
+	IB_WC_SEND		= IB_UVERBS_WC_SEND,
+	IB_WC_RDMA_WRITE	= IB_UVERBS_WC_RDMA_WRITE,
+	IB_WC_RDMA_READ		= IB_UVERBS_WC_RDMA_READ,
+	IB_WC_COMP_SWAP		= IB_UVERBS_WC_COMP_SWAP,
+	IB_WC_FETCH_ADD		= IB_UVERBS_WC_FETCH_ADD,
+	IB_WC_LSO		= IB_UVERBS_WC_SEND_END,
+	IB_WC_LOCAL_INV		= IB_UVERBS_WC_SEND_END + 1,
+	IB_WC_REG_MR		= IB_UVERBS_WC_SEND_END + 2,
+	IB_WC_MASKED_COMP_SWAP	= IB_UVERBS_WC_SEND_END + 3,
+	IB_WC_MASKED_FETCH_ADD	= IB_UVERBS_WC_SEND_END + 4,
+
+	IB_WC_RECV		= IB_UVERBS_WC_RECV,
+	IB_WC_RECV_RDMA_WITH_IMM = IB_UVERBS_WC_RECV_END,
 };
 
 enum ib_wc_flags {
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
index 3be3152..fd7a393 100644
--- a/include/uapi/rdma/ib_verbs.h
+++ b/include/uapi/rdma/ib_verbs.h
@@ -29,4 +29,20 @@ enum ib_uverbs_send_flags {
 	IB_UVERBS_SEND_END			= (1 << 5),
 };
 
+enum ib_uverbs_wc_opcode {
+	IB_UVERBS_WC_SEND			= 0,
+	IB_UVERBS_WC_RDMA_WRITE			= 1,
+	IB_UVERBS_WC_RDMA_READ			= 2,
+	IB_UVERBS_WC_COMP_SWAP			= 3,
+	IB_UVERBS_WC_FETCH_ADD			= 4,
+	IB_UVERBS_WC_SEND_END			= 5,
+
+	/*
+	 * Set value of IB_WC_RECV so consumers can test if a completion is a
+	 * receive by testing (opcode & IB_WC_RECV).
+	 */
+	IB_UVERBS_WC_RECV			= 1 << 7,
+	IB_UVERBS_WC_RECV_END			= (1 << 7) + 1,
+};
+
 #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/6] IB/uapi: expose uverbs WC flags
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-12-24 14:39   ` [PATCH 3/6] IB/uapi: expose uverbs WC opcodes Christoph Hellwig
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-5-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 5/6] IB/uapi: expose uverbs WC status codes Christoph Hellwig
                     ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

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-jcswGhMUV9g@public.gmane.org>
---
 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),
+};
+
 #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/6] IB/uapi: expose uverbs WC status codes
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
                     ` (3 preceding siblings ...)
  2015-12-24 14:39   ` [PATCH 4/6] IB/uapi: expose uverbs WC flags Christoph Hellwig
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-6-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2015-12-24 14:39   ` [PATCH 6/6] IB/uapi: expose device capability flags Christoph Hellwig
  2016-01-04 17:02   ` start moving user space visible constants to uapi headers Steve Wise
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

This exposes the WC status codes supported by uverbs as part of the uapi
headers.  It follows the same scheme as the WR opcodes.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 include/rdma/ib_verbs.h      | 44 ++++++++++++++++++++++----------------------
 include/uapi/rdma/ib_verbs.h | 25 +++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 337db70..48bfcf5 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -792,28 +792,28 @@ struct ib_ah_attr {
 };
 
 enum ib_wc_status {
-	IB_WC_SUCCESS,
-	IB_WC_LOC_LEN_ERR,
-	IB_WC_LOC_QP_OP_ERR,
-	IB_WC_LOC_EEC_OP_ERR,
-	IB_WC_LOC_PROT_ERR,
-	IB_WC_WR_FLUSH_ERR,
-	IB_WC_MW_BIND_ERR,
-	IB_WC_BAD_RESP_ERR,
-	IB_WC_LOC_ACCESS_ERR,
-	IB_WC_REM_INV_REQ_ERR,
-	IB_WC_REM_ACCESS_ERR,
-	IB_WC_REM_OP_ERR,
-	IB_WC_RETRY_EXC_ERR,
-	IB_WC_RNR_RETRY_EXC_ERR,
-	IB_WC_LOC_RDD_VIOL_ERR,
-	IB_WC_REM_INV_RD_REQ_ERR,
-	IB_WC_REM_ABORT_ERR,
-	IB_WC_INV_EECN_ERR,
-	IB_WC_INV_EEC_STATE_ERR,
-	IB_WC_FATAL_ERR,
-	IB_WC_RESP_TIMEOUT_ERR,
-	IB_WC_GENERAL_ERR
+	IB_WC_SUCCESS		= IB_UVERBS_WC_SUCCESS,
+	IB_WC_LOC_LEN_ERR	= IB_UVERBS_WC_LOC_LEN_ERR,
+	IB_WC_LOC_QP_OP_ERR	= IB_UVERBS_WC_LOC_QP_OP_ERR,
+	IB_WC_LOC_EEC_OP_ERR	= IB_UVERBS_WC_LOC_EEC_OP_ERR,
+	IB_WC_LOC_PROT_ERR	= IB_UVERBS_WC_LOC_PROT_ERR,
+	IB_WC_WR_FLUSH_ERR	= IB_UVERBS_WC_WR_FLUSH_ERR,
+	IB_WC_MW_BIND_ERR	= IB_UVERBS_WC_MW_BIND_ERR,
+	IB_WC_BAD_RESP_ERR	= IB_UVERBS_WC_BAD_RESP_ERR,
+	IB_WC_LOC_ACCESS_ERR	= IB_UVERBS_WC_LOC_ACCESS_ERR,
+	IB_WC_REM_INV_REQ_ERR	= IB_UVERBS_WC_REM_INV_REQ_ERR,
+	IB_WC_REM_ACCESS_ERR	= IB_UVERBS_WC_REM_ACCESS_ERR,
+	IB_WC_REM_OP_ERR	= IB_UVERBS_WC_REM_OP_ERR,
+	IB_WC_RETRY_EXC_ERR	= IB_UVERBS_WC_RETRY_EXC_ERR,
+	IB_WC_RNR_RETRY_EXC_ERR	= IB_UVERBS_WC_RNR_RETRY_EXC_ERR,
+	IB_WC_LOC_RDD_VIOL_ERR	= IB_UVERBS_WC_LOC_RDD_VIOL_ERR,
+	IB_WC_REM_INV_RD_REQ_ERR= IB_UVERBS_WC_REM_INV_RD_REQ_ERR,
+	IB_WC_REM_ABORT_ERR	= IB_UVERBS_WC_REM_ABORT_ERR,
+	IB_WC_INV_EECN_ERR	= IB_UVERBS_WC_INV_EECN_ERR,
+	IB_WC_INV_EEC_STATE_ERR = IB_UVERBS_WC_INV_EEC_STATE_ERR,
+	IB_WC_FATAL_ERR		= IB_UVERBS_WC_FATAL_ERR,
+	IB_WC_RESP_TIMEOUT_ERR	= IB_UVERBS_WC_RESP_TIMEOUT_ERR,
+	IB_WC_GENERAL_ERR	= IB_UVERBS_WC_GENERAL_ERR,
 };
 
 const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
index c40c00b..fbadb29 100644
--- a/include/uapi/rdma/ib_verbs.h
+++ b/include/uapi/rdma/ib_verbs.h
@@ -55,4 +55,29 @@ enum ib_uverbs_wc_flags {
 	IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE	= (1 << 6),
 };
 
+enum ib_uverbs_wc_status {
+	IB_UVERBS_WC_SUCCESS,
+	IB_UVERBS_WC_LOC_LEN_ERR,
+	IB_UVERBS_WC_LOC_QP_OP_ERR,
+	IB_UVERBS_WC_LOC_EEC_OP_ERR,
+	IB_UVERBS_WC_LOC_PROT_ERR,
+	IB_UVERBS_WC_WR_FLUSH_ERR,
+	IB_UVERBS_WC_MW_BIND_ERR,
+	IB_UVERBS_WC_BAD_RESP_ERR,
+	IB_UVERBS_WC_LOC_ACCESS_ERR,
+	IB_UVERBS_WC_REM_INV_REQ_ERR,
+	IB_UVERBS_WC_REM_ACCESS_ERR,
+	IB_UVERBS_WC_REM_OP_ERR,
+	IB_UVERBS_WC_RETRY_EXC_ERR,
+	IB_UVERBS_WC_RNR_RETRY_EXC_ERR,
+	IB_UVERBS_WC_LOC_RDD_VIOL_ERR,
+	IB_UVERBS_WC_REM_INV_RD_REQ_ERR,
+	IB_UVERBS_WC_REM_ABORT_ERR,
+	IB_UVERBS_WC_INV_EECN_ERR,
+	IB_UVERBS_WC_INV_EEC_STATE_ERR,
+	IB_UVERBS_WC_FATAL_ERR,
+	IB_UVERBS_WC_RESP_TIMEOUT_ERR,
+	IB_UVERBS_WC_GENERAL_ERR
+};
+
 #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/6] IB/uapi: expose device capability flags
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
                     ` (4 preceding siblings ...)
  2015-12-24 14:39   ` [PATCH 5/6] IB/uapi: expose uverbs WC status codes Christoph Hellwig
@ 2015-12-24 14:39   ` Christoph Hellwig
       [not found]     ` <1450967967-12479-7-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
  2016-01-04 17:02   ` start moving user space visible constants to uapi headers Steve Wise
  6 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-24 14:39 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Expose the device capability flags which can be queried through uverbs in
the uapi headers.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 include/rdma/ib_verbs.h      | 94 +++++++++++++++-----------------------------
 include/uapi/rdma/ib_verbs.h | 66 +++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 62 deletions(-)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 48bfcf5..b8d4113 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -151,68 +151,38 @@ enum rdma_link_layer {
 };
 
 enum ib_device_cap_flags {
-	IB_DEVICE_RESIZE_MAX_WR			= (1 << 0),
-	IB_DEVICE_BAD_PKEY_CNTR			= (1 << 1),
-	IB_DEVICE_BAD_QKEY_CNTR			= (1 << 2),
-	IB_DEVICE_RAW_MULTI			= (1 << 3),
-	IB_DEVICE_AUTO_PATH_MIG			= (1 << 4),
-	IB_DEVICE_CHANGE_PHY_PORT		= (1 << 5),
-	IB_DEVICE_UD_AV_PORT_ENFORCE		= (1 << 6),
-	IB_DEVICE_CURR_QP_STATE_MOD		= (1 << 7),
-	IB_DEVICE_SHUTDOWN_PORT			= (1 << 8),
-	IB_DEVICE_INIT_TYPE			= (1 << 9),
-	IB_DEVICE_PORT_ACTIVE_EVENT		= (1 << 10),
-	IB_DEVICE_SYS_IMAGE_GUID		= (1 << 11),
-	IB_DEVICE_RC_RNR_NAK_GEN		= (1 << 12),
-	IB_DEVICE_SRQ_RESIZE			= (1 << 13),
-	IB_DEVICE_N_NOTIFY_CQ			= (1 << 14),
-
-	/*
-	 * 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_DEVICE_LOCAL_DMA_LKEY		= (1 << 15),
-	IB_DEVICE_RESERVED /* old SEND_W_INV */	= (1 << 16),
-	IB_DEVICE_MEM_WINDOW			= (1 << 17),
-	/*
-	 * Devices should set IB_DEVICE_UD_IP_SUM if they support
-	 * insertion of UDP and TCP checksum on outgoing UD IPoIB
-	 * messages and can verify the validity of checksum for
-	 * incoming messages.  Setting this flag implies that the
-	 * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode.
-	 */
-	IB_DEVICE_UD_IP_CSUM			= (1 << 18),
-	IB_DEVICE_UD_TSO			= (1 << 19),
-	IB_DEVICE_XRC				= (1 << 20),
-
-	/*
-	 * This device supports the IB "base memory management extension",
-	 * which includes support for fast registrations (IB_WR_REG_MR,
-	 * IB_WR_LOCAL_INV and IB_WR_SEND_WITH_INV verbs).  This flag should
-	 * also be set by any iWarp device which must support FRs to comply
-	 * to the iWarp verbs spec.  iWarp devices also support the
-	 * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the
-	 * stag.
-	 */
-	IB_DEVICE_MEM_MGT_EXTENSIONS		= (1 << 21),
-	IB_DEVICE_BLOCK_MULTICAST_LOOPBACK	= (1 << 22),
-	IB_DEVICE_MEM_WINDOW_TYPE_2A		= (1 << 23),
-	IB_DEVICE_MEM_WINDOW_TYPE_2B		= (1 << 24),
-	IB_DEVICE_RC_IP_CSUM			= (1 << 25),
-	IB_DEVICE_RAW_IP_CSUM			= (1 << 26),
-	/*
-	 * Devices should set IB_DEVICE_CROSS_CHANNEL if they
-	 * support execution of WQEs that involve synchronization
-	 * of I/O operations with single completion queue managed
-	 * by hardware.
-	 */
-	IB_DEVICE_CROSS_CHANNEL		= (1 << 27),
-	IB_DEVICE_MANAGED_FLOW_STEERING		= (1 << 29),
-	IB_DEVICE_SIGNATURE_HANDOVER		= (1 << 30),
-	IB_DEVICE_ON_DEMAND_PAGING		= (1 << 31),
+	IB_DEVICE_RESIZE_MAX_WR		= IB_UVERBS_DEVICE_RESIZE_MAX_WR,
+	IB_DEVICE_BAD_PKEY_CNTR		= IB_UVERBS_DEVICE_BAD_PKEY_CNTR,
+	IB_DEVICE_BAD_QKEY_CNTR		= IB_UVERBS_DEVICE_BAD_QKEY_CNTR,
+	IB_DEVICE_RAW_MULTI		= IB_UVERBS_DEVICE_RAW_MULTI,
+	IB_DEVICE_AUTO_PATH_MIG		= IB_UVERBS_DEVICE_AUTO_PATH_MIG,
+	IB_DEVICE_CHANGE_PHY_PORT	= IB_UVERBS_DEVICE_CHANGE_PHY_PORT,
+	IB_DEVICE_UD_AV_PORT_ENFORCE	= IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE,
+	IB_DEVICE_CURR_QP_STATE_MOD	= IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE,
+	IB_DEVICE_SHUTDOWN_PORT		= IB_UVERBS_DEVICE_SHUTDOWN_PORT,
+	IB_DEVICE_INIT_TYPE		= IB_UVERBS_DEVICE_INIT_TYPE,
+	IB_DEVICE_PORT_ACTIVE_EVENT	= IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT,
+	IB_DEVICE_SYS_IMAGE_GUID	= IB_UVERBS_DEVICE_SYS_IMAGE_GUID,
+	IB_DEVICE_RC_RNR_NAK_GEN	= IB_UVERBS_DEVICE_RC_RNR_NAK_GEN,
+	IB_DEVICE_SRQ_RESIZE		= IB_UVERBS_DEVICE_SRQ_RESIZE,
+	IB_DEVICE_N_NOTIFY_CQ		= IB_UVERBS_DEVICE_N_NOTIFY_CQ,
+	IB_DEVICE_LOCAL_DMA_LKEY	= IB_UVERBS_DEVICE_LOCAL_DMA_LKEY,
+	IB_DEVICE_MEM_WINDOW		= IB_UVERBS_DEVICE_MEM_WINDOW,
+	IB_DEVICE_UD_IP_CSUM		= IB_UVERBS_DEVICE_UD_IP_CSUM,
+	IB_DEVICE_UD_TSO		= IB_UVERBS_DEVICE_UD_TSO,
+	IB_DEVICE_XRC			= IB_UVERBS_DEVICE_XRC,
+	IB_DEVICE_MEM_MGT_EXTENSIONS	= IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS,
+	IB_DEVICE_BLOCK_MULTICAST_LOOPBACK =
+			IB_UVERBS_DEVICE_BLOCK_MULTICAST_LOOPBACK,
+	IB_DEVICE_MEM_WINDOW_TYPE_2A	= IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A,
+	IB_DEVICE_MEM_WINDOW_TYPE_2B	= IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B,
+	IB_DEVICE_RC_IP_CSUM		= IB_UVERBS_DEVICE_RC_IP_CSUM,
+	IB_DEVICE_RAW_IP_CSUM		= IB_UVERBS_DEVICE_RAW_IP_CSUM,
+	IB_DEVICE_CROSS_CHANNEL		= IB_UVERBS_DEVICE_CROSS_CHANNEL,
+	IB_DEVICE_MANAGED_FLOW_STEERING	=
+			IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING,
+	IB_DEVICE_SIGNATURE_HANDOVER	= IB_UVERBS_DEVICE_SIGNATURE_HANDOVER,
+	IB_DEVICE_ON_DEMAND_PAGING	= IB_UVERBS_DEVICE_ON_DEMAND_PAGING,
 };
 
 enum ib_signature_prot_cap {
diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
index fbadb29..8bba4c4 100644
--- a/include/uapi/rdma/ib_verbs.h
+++ b/include/uapi/rdma/ib_verbs.h
@@ -7,6 +7,72 @@
  * having to pull that into the kernel-internal internal ib_verbs.h
  */
 
+enum ib_uverbs_device_cap_flags {
+	IB_UVERBS_DEVICE_RESIZE_MAX_WR		= (1 << 0),
+	IB_UVERBS_DEVICE_BAD_PKEY_CNTR		= (1 << 1),
+	IB_UVERBS_DEVICE_BAD_QKEY_CNTR		= (1 << 2),
+	IB_UVERBS_DEVICE_RAW_MULTI		= (1 << 3),
+	IB_UVERBS_DEVICE_AUTO_PATH_MIG		= (1 << 4),
+	IB_UVERBS_DEVICE_CHANGE_PHY_PORT	= (1 << 5),
+	IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE	= (1 << 6),
+	IB_UVERBS_DEVICE_CURR_QP_STATE_MOD	= (1 << 7),
+	IB_UVERBS_DEVICE_SHUTDOWN_PORT		= (1 << 8),
+	IB_UVERBS_DEVICE_INIT_TYPE		= (1 << 9),
+	IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT	= (1 << 10),
+	IB_UVERBS_DEVICE_SYS_IMAGE_GUID		= (1 << 11),
+	IB_UVERBS_DEVICE_RC_RNR_NAK_GEN		= (1 << 12),
+	IB_UVERBS_DEVICE_SRQ_RESIZE		= (1 << 13),
+	IB_UVERBS_DEVICE_N_NOTIFY_CQ		= (1 << 14),
+
+	/*
+	 * 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_UVERBS_DEVICE_LOCAL_DMA_LKEY		= (1 << 15),
+	IB_UVERBS_DEVICE_MEM_WINDOW		= (1 << 17),
+
+	/*
+	 * Devices should set IB_UVERBS_DEVICE_UD_IP_SUM if they support
+	 * insertion of UDP and TCP checksum on outgoing UD IPoIB
+	 * messages and can verify the validity of checksum for
+	 * incoming messages.  Setting this flag implies that the
+	 * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode.
+	 */
+	IB_UVERBS_DEVICE_UD_IP_CSUM		= (1 << 18),
+	IB_UVERBS_DEVICE_UD_TSO			= (1 << 19),
+	IB_UVERBS_DEVICE_XRC			= (1 << 20),
+
+	/*
+	 * This device supports the IB "base memory management extension",
+	 * which includes support for fast registrations (IB_WR_REG_MR,
+	 * IB_WR_LOCAL_INV and IB_WR_SEND_WITH_INV verbs).  This flag should
+	 * also be set by any iWarp device which must support FRs to comply
+	 * to the iWarp verbs spec.  iWarp devices also support the
+	 * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the
+	 * stag.
+	 */
+	IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS	= (1 << 21),
+	IB_UVERBS_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1 << 22),
+	IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A	= (1 << 23),
+	IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B	= (1 << 24),
+	IB_UVERBS_DEVICE_RC_IP_CSUM		= (1 << 25),
+	IB_UVERBS_DEVICE_RAW_IP_CSUM		= (1 << 26),
+
+	/*
+	 * Devices should set IB_UVERBS_DEVICE_CROSS_CHANNEL if they
+	 * support execution of WQEs that involve synchronization
+	 * of I/O operations with single completion queue managed
+	 * by hardware.
+	 */
+	IB_UVERBS_DEVICE_CROSS_CHANNEL		= (1 << 27),
+	IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING	= (1 << 29),
+	IB_UVERBS_DEVICE_SIGNATURE_HANDOVER	= (1 << 30),
+	IB_UVERBS_DEVICE_ON_DEMAND_PAGING	= (1 << 31),
+};
+
 enum ib_uverbs_wr_opcode {
 	IB_UVERBS_WR_RDMA_WRITE			= 0,
 	IB_UVERBS_WR_RDMA_WRITE_WITH_IMM	= 1,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/6] IB/uapi: expose uverbs WR opcodes
       [not found]     ` <1450967967-12479-2-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-27  6:04       ` Leon Romanovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2015-12-27  6:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, Dec 24, 2015 at 03:39:22PM +0100, Christoph Hellwig wrote:
....
>  #define MLX5_IB_SEND_UMR_UPDATE_MTT (IB_SEND_RESERVED_START << 2)
>  #define MLX5_IB_QPT_REG_UMR	IB_QPT_RESERVED1
> -#define MLX5_IB_WR_UMR		IB_WR_RESERVED1
> +#define MLX5_IB_WR_UMR		(IB_WR_END + 0)
....
>  
> -	IB_WR_RESERVED10,
> +
> +	/* drivers may use any value greater or equal to IB_WR_END internally */
> +	IB_WR_END,
IB_WR_END --> IB_WR_KERNEL_LAST
>  };
>  
....
> +	IB_UVERBS_WR_END			= 9,
I think name IB_UVERBS_WR_LAST describes better than IB_UVERBS_WR_END.
> +};
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/6] IB/uapi: expose uverbs WC opcodes
       [not found]     ` <1450967967-12479-4-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-27  6:12       ` Leon Romanovsky
       [not found]         ` <20151227061202.GB8501-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Leon Romanovsky @ 2015-12-27  6:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, Dec 24, 2015 at 03:39:24PM +0100, Christoph Hellwig wrote:
> This exposes the WC opcodes supported by uverbs as part of the uapi
> headers.  It follows the same scheme as the WR opcodes.
> 
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> ---
>  include/rdma/ib_verbs.h      | 29 +++++++++++++----------------
>  include/uapi/rdma/ib_verbs.h | 16 ++++++++++++++++
>  2 files changed, 29 insertions(+), 16 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 5dccc6a..7dce204 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -819,22 +819,19 @@ enum ib_wc_status {
>  const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
>  
>  enum ib_wc_opcode {
> -	IB_WC_SEND,
> -	IB_WC_RDMA_WRITE,
> -	IB_WC_RDMA_READ,
> -	IB_WC_COMP_SWAP,
> -	IB_WC_FETCH_ADD,
> -	IB_WC_LSO,
> -	IB_WC_LOCAL_INV,
> -	IB_WC_REG_MR,
> -	IB_WC_MASKED_COMP_SWAP,
> -	IB_WC_MASKED_FETCH_ADD,
> -/*
> - * Set value of IB_WC_RECV so consumers can test if a completion is a
> - * receive by testing (opcode & IB_WC_RECV).
> - */
> -	IB_WC_RECV			= 1 << 7,
> -	IB_WC_RECV_RDMA_WITH_IMM
> +	IB_WC_SEND		= IB_UVERBS_WC_SEND,
> +	IB_WC_RDMA_WRITE	= IB_UVERBS_WC_RDMA_WRITE,
> +	IB_WC_RDMA_READ		= IB_UVERBS_WC_RDMA_READ,
> +	IB_WC_COMP_SWAP		= IB_UVERBS_WC_COMP_SWAP,
> +	IB_WC_FETCH_ADD		= IB_UVERBS_WC_FETCH_ADD,
> +	IB_WC_LSO		= IB_UVERBS_WC_SEND_END,
> +	IB_WC_LOCAL_INV		= IB_UVERBS_WC_SEND_END + 1,
> +	IB_WC_REG_MR		= IB_UVERBS_WC_SEND_END + 2,
> +	IB_WC_MASKED_COMP_SWAP	= IB_UVERBS_WC_SEND_END + 3,
> +	IB_WC_MASKED_FETCH_ADD	= IB_UVERBS_WC_SEND_END + 4,
As you did it in the first patch, just don't assign after IB_WC_LOCAL_INV.
Compiler will handle IB_UVERS_WC_SEND_END + X calculations by itself.
> +
> +	IB_WC_RECV		= IB_UVERBS_WC_RECV,
> +	IB_WC_RECV_RDMA_WITH_IMM = IB_UVERBS_WC_RECV_END,
>  };
>  
>  enum ib_wc_flags {
> diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
> index 3be3152..fd7a393 100644
> --- a/include/uapi/rdma/ib_verbs.h
> +++ b/include/uapi/rdma/ib_verbs.h
> @@ -29,4 +29,20 @@ enum ib_uverbs_send_flags {
>  	IB_UVERBS_SEND_END			= (1 << 5),
>  };
>  
> +enum ib_uverbs_wc_opcode {
> +	IB_UVERBS_WC_SEND			= 0,
> +	IB_UVERBS_WC_RDMA_WRITE			= 1,
> +	IB_UVERBS_WC_RDMA_READ			= 2,
> +	IB_UVERBS_WC_COMP_SWAP			= 3,
> +	IB_UVERBS_WC_FETCH_ADD			= 4,
> +	IB_UVERBS_WC_SEND_END			= 5,
> +
> +	/*
> +	 * Set value of IB_WC_RECV so consumers can test if a completion is a
> +	 * receive by testing (opcode & IB_WC_RECV).
> +	 */
> +	IB_UVERBS_WC_RECV			= 1 << 7,
> +	IB_UVERBS_WC_RECV_END			= (1 << 7) + 1,
> +};
> +
>  #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/6] IB/uapi: expose uverbs WC flags
       [not found]     ` <1450967967-12479-5-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-27  6:15       ` Leon Romanovsky
       [not found]         ` <20151227061545.GC8501-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Leon Romanovsky @ 2015-12-27  6:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

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-jcswGhMUV9g@public.gmane.org>
> ---
>  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-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 5/6] IB/uapi: expose uverbs WC status codes
       [not found]     ` <1450967967-12479-6-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-27  6:17       ` Leon Romanovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2015-12-27  6:17 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, Dec 24, 2015 at 03:39:26PM +0100, Christoph Hellwig wrote:
> This exposes the WC status codes supported by uverbs as part of the uapi
> headers.  It follows the same scheme as the WR opcodes.
> 
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> ---
>  include/rdma/ib_verbs.h      | 44 ++++++++++++++++++++++----------------------
>  include/uapi/rdma/ib_verbs.h | 25 +++++++++++++++++++++++++
>  2 files changed, 47 insertions(+), 22 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 337db70..48bfcf5 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -792,28 +792,28 @@ struct ib_ah_attr {
>  };
>  
>  enum ib_wc_status {
> -	IB_WC_SUCCESS,
> -	IB_WC_LOC_LEN_ERR,
> -	IB_WC_LOC_QP_OP_ERR,
> -	IB_WC_LOC_EEC_OP_ERR,
> -	IB_WC_LOC_PROT_ERR,
> -	IB_WC_WR_FLUSH_ERR,
> -	IB_WC_MW_BIND_ERR,
> -	IB_WC_BAD_RESP_ERR,
> -	IB_WC_LOC_ACCESS_ERR,
> -	IB_WC_REM_INV_REQ_ERR,
> -	IB_WC_REM_ACCESS_ERR,
> -	IB_WC_REM_OP_ERR,
> -	IB_WC_RETRY_EXC_ERR,
> -	IB_WC_RNR_RETRY_EXC_ERR,
> -	IB_WC_LOC_RDD_VIOL_ERR,
> -	IB_WC_REM_INV_RD_REQ_ERR,
> -	IB_WC_REM_ABORT_ERR,
> -	IB_WC_INV_EECN_ERR,
> -	IB_WC_INV_EEC_STATE_ERR,
> -	IB_WC_FATAL_ERR,
> -	IB_WC_RESP_TIMEOUT_ERR,
> -	IB_WC_GENERAL_ERR
> +	IB_WC_SUCCESS		= IB_UVERBS_WC_SUCCESS,
> +	IB_WC_LOC_LEN_ERR	= IB_UVERBS_WC_LOC_LEN_ERR,
> +	IB_WC_LOC_QP_OP_ERR	= IB_UVERBS_WC_LOC_QP_OP_ERR,
> +	IB_WC_LOC_EEC_OP_ERR	= IB_UVERBS_WC_LOC_EEC_OP_ERR,
> +	IB_WC_LOC_PROT_ERR	= IB_UVERBS_WC_LOC_PROT_ERR,
> +	IB_WC_WR_FLUSH_ERR	= IB_UVERBS_WC_WR_FLUSH_ERR,
> +	IB_WC_MW_BIND_ERR	= IB_UVERBS_WC_MW_BIND_ERR,
> +	IB_WC_BAD_RESP_ERR	= IB_UVERBS_WC_BAD_RESP_ERR,
> +	IB_WC_LOC_ACCESS_ERR	= IB_UVERBS_WC_LOC_ACCESS_ERR,
> +	IB_WC_REM_INV_REQ_ERR	= IB_UVERBS_WC_REM_INV_REQ_ERR,
> +	IB_WC_REM_ACCESS_ERR	= IB_UVERBS_WC_REM_ACCESS_ERR,
> +	IB_WC_REM_OP_ERR	= IB_UVERBS_WC_REM_OP_ERR,
> +	IB_WC_RETRY_EXC_ERR	= IB_UVERBS_WC_RETRY_EXC_ERR,
> +	IB_WC_RNR_RETRY_EXC_ERR	= IB_UVERBS_WC_RNR_RETRY_EXC_ERR,
> +	IB_WC_LOC_RDD_VIOL_ERR	= IB_UVERBS_WC_LOC_RDD_VIOL_ERR,
> +	IB_WC_REM_INV_RD_REQ_ERR= IB_UVERBS_WC_REM_INV_RD_REQ_ERR,
> +	IB_WC_REM_ABORT_ERR	= IB_UVERBS_WC_REM_ABORT_ERR,
> +	IB_WC_INV_EECN_ERR	= IB_UVERBS_WC_INV_EECN_ERR,
> +	IB_WC_INV_EEC_STATE_ERR = IB_UVERBS_WC_INV_EEC_STATE_ERR,
> +	IB_WC_FATAL_ERR		= IB_UVERBS_WC_FATAL_ERR,
> +	IB_WC_RESP_TIMEOUT_ERR	= IB_UVERBS_WC_RESP_TIMEOUT_ERR,
> +	IB_WC_GENERAL_ERR	= IB_UVERBS_WC_GENERAL_ERR,
>  };
>  
>  const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
> diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
> index c40c00b..fbadb29 100644
> --- a/include/uapi/rdma/ib_verbs.h
> +++ b/include/uapi/rdma/ib_verbs.h
> @@ -55,4 +55,29 @@ enum ib_uverbs_wc_flags {
>  	IB_UVERBS_WC_WITH_NETWORK_HDR_TYPE	= (1 << 6),
>  };
>  
> +enum ib_uverbs_wc_status {
> +	IB_UVERBS_WC_SUCCESS,
> +	IB_UVERBS_WC_LOC_LEN_ERR,
> +	IB_UVERBS_WC_LOC_QP_OP_ERR,
> +	IB_UVERBS_WC_LOC_EEC_OP_ERR,
> +	IB_UVERBS_WC_LOC_PROT_ERR,
> +	IB_UVERBS_WC_WR_FLUSH_ERR,
> +	IB_UVERBS_WC_MW_BIND_ERR,
> +	IB_UVERBS_WC_BAD_RESP_ERR,
> +	IB_UVERBS_WC_LOC_ACCESS_ERR,
> +	IB_UVERBS_WC_REM_INV_REQ_ERR,
> +	IB_UVERBS_WC_REM_ACCESS_ERR,
> +	IB_UVERBS_WC_REM_OP_ERR,
> +	IB_UVERBS_WC_RETRY_EXC_ERR,
> +	IB_UVERBS_WC_RNR_RETRY_EXC_ERR,
> +	IB_UVERBS_WC_LOC_RDD_VIOL_ERR,
> +	IB_UVERBS_WC_REM_INV_RD_REQ_ERR,
> +	IB_UVERBS_WC_REM_ABORT_ERR,
> +	IB_UVERBS_WC_INV_EECN_ERR,
> +	IB_UVERBS_WC_INV_EEC_STATE_ERR,
> +	IB_UVERBS_WC_FATAL_ERR,
> +	IB_UVERBS_WC_RESP_TIMEOUT_ERR,
> +	IB_UVERBS_WC_GENERAL_ERR
> +};
The same as in previous mail, mark it as a _STATUS_ in the name.
> +
>  #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-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/6] IB/uapi: expose uverbs WC opcodes
       [not found]         ` <20151227061202.GB8501-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-29 11:02           ` Sagi Grimberg
       [not found]             ` <5682685E.90700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Sagi Grimberg @ 2015-12-29 11:02 UTC (permalink / raw)
  To: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA


>> +	IB_WC_SEND		= IB_UVERBS_WC_SEND,
>> +	IB_WC_RDMA_WRITE	= IB_UVERBS_WC_RDMA_WRITE,
>> +	IB_WC_RDMA_READ		= IB_UVERBS_WC_RDMA_READ,
>> +	IB_WC_COMP_SWAP		= IB_UVERBS_WC_COMP_SWAP,
>> +	IB_WC_FETCH_ADD		= IB_UVERBS_WC_FETCH_ADD,
>> +	IB_WC_LSO		= IB_UVERBS_WC_SEND_END,
>> +	IB_WC_LOCAL_INV		= IB_UVERBS_WC_SEND_END + 1,
>> +	IB_WC_REG_MR		= IB_UVERBS_WC_SEND_END + 2,
>> +	IB_WC_MASKED_COMP_SWAP	= IB_UVERBS_WC_SEND_END + 3,
>> +	IB_WC_MASKED_FETCH_ADD	= IB_UVERBS_WC_SEND_END + 4,
> As you did it in the first patch, just don't assign after IB_WC_LOCAL_INV.
> Compiler will handle IB_UVERS_WC_SEND_END + X calculations by itself.

I disagree, I'd say its better to keep the code verbosity level here...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/6] IB/uapi: expose uverbs WC flags
       [not found]         ` <20151227061545.GC8501-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-29 11:04           ` Sagi Grimberg
  0 siblings, 0 replies; 18+ messages in thread
From: Sagi Grimberg @ 2015-12-29 11:04 UTC (permalink / raw)
  To: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA


>> +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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/6] IB/uapi: expose uverbs WC opcodes
       [not found]             ` <5682685E.90700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2015-12-30  9:44               ` Christoph Hellwig
       [not found]                 ` <20151230094429.GD12904-jcswGhMUV9g@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2015-12-30  9:44 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Dec 29, 2015 at 01:02:54PM +0200, Sagi Grimberg wrote:
>> As you did it in the first patch, just don't assign after IB_WC_LOCAL_INV.
>> Compiler will handle IB_UVERS_WC_SEND_END + X calculations by itself.
>
> I disagree, I'd say its better to keep the code verbosity level here...

I really don't like enum auto assignment for constants that are fixe
as part of an ABI.  There is too much chance of things going wrong.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/6] IB/uapi: expose uverbs WC opcodes
       [not found]                 ` <20151230094429.GD12904-jcswGhMUV9g@public.gmane.org>
@ 2015-12-30 11:28                   ` Leon Romanovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Leon Romanovsky @ 2015-12-30 11:28 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sagi Grimberg, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, Dec 30, 2015 at 10:44:29AM +0100, Christoph Hellwig wrote:
> On Tue, Dec 29, 2015 at 01:02:54PM +0200, Sagi Grimberg wrote:
> >> As you did it in the first patch, just don't assign after IB_WC_LOCAL_INV.
> >> Compiler will handle IB_UVERS_WC_SEND_END + X calculations by itself.
> >
> > I disagree, I'd say its better to keep the code verbosity level here...
> 
> I really don't like enum auto assignment for constants that are fixe
> as part of an ABI.  There is too much chance of things going wrong.

It is up to you, just be constant in your enums assignments.

Thanks.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/6] IB/uapi: expose uverbs send WR flags
       [not found]     ` <1450967967-12479-3-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-31 14:45       ` Haggai Eran
  0 siblings, 0 replies; 18+ messages in thread
From: Haggai Eran @ 2015-12-31 14:45 UTC (permalink / raw)
  To: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 24/12/2015 16:39, Christoph Hellwig wrote:
> This exposes the send WR 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-jcswGhMUV9g@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/mlx5_ib.h |  6 +++---
>  include/rdma/ib_verbs.h              | 14 ++++++--------
>  include/uapi/rdma/ib_verbs.h         |  9 +++++++++
>  3 files changed, 18 insertions(+), 11 deletions(-)
> 

> diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h
> index 330175e..3be3152 100644
> --- a/include/uapi/rdma/ib_verbs.h
> +++ b/include/uapi/rdma/ib_verbs.h
> @@ -20,4 +20,13 @@ enum ib_uverbs_wr_opcode {
>  	IB_UVERBS_WR_END			= 9,
>  };
>  
> +enum ib_uverbs_send_flags {
> +	IB_UVERBS_SEND_FENCE			= (1 << 0),
> +	IB_UVERBS_SEND_SIGNALED			= (1 << 1),
> +	IB_UVERBS_SEND_SOLICITED		= (1 << 2),
> +	IB_UVERBS_SEND_INLINE			= (1 << 3),
> +	IB_UVERBS_SEND_IP_CSUM			= (1 << 4),
> +	IB_UVERBS_SEND_END			= (1 << 5),

Do you think we need a check in ib_uverbs_post_send to see only 
user flags are passed? I think it would be safer.

Other than that,
Reviewed-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/6] IB/uapi: expose device capability flags
       [not found]     ` <1450967967-12479-7-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
@ 2015-12-31 15:17       ` Haggai Eran
  0 siblings, 0 replies; 18+ messages in thread
From: Haggai Eran @ 2015-12-31 15:17 UTC (permalink / raw)
  To: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 24/12/2015 16:39, Christoph Hellwig wrote:
> Expose the device capability flags which can be queried through uverbs in
> the uapi headers.
> 
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> ---
>  include/rdma/ib_verbs.h      | 94 +++++++++++++++-----------------------------
>  include/uapi/rdma/ib_verbs.h | 66 +++++++++++++++++++++++++++++++
>  2 files changed, 98 insertions(+), 62 deletions(-)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 48bfcf5..b8d4113 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -151,68 +151,38 @@ enum rdma_link_layer {
>  };
>  
>  enum ib_device_cap_flags {
> -	IB_DEVICE_RESIZE_MAX_WR			= (1 << 0),
> -	IB_DEVICE_BAD_PKEY_CNTR			= (1 << 1),
> -	IB_DEVICE_BAD_QKEY_CNTR			= (1 << 2),
> -	IB_DEVICE_RAW_MULTI			= (1 << 3),
> -	IB_DEVICE_AUTO_PATH_MIG			= (1 << 4),
> -	IB_DEVICE_CHANGE_PHY_PORT		= (1 << 5),
> -	IB_DEVICE_UD_AV_PORT_ENFORCE		= (1 << 6),
> -	IB_DEVICE_CURR_QP_STATE_MOD		= (1 << 7),
> -	IB_DEVICE_SHUTDOWN_PORT			= (1 << 8),
> -	IB_DEVICE_INIT_TYPE			= (1 << 9),
> -	IB_DEVICE_PORT_ACTIVE_EVENT		= (1 << 10),
> -	IB_DEVICE_SYS_IMAGE_GUID		= (1 << 11),
> -	IB_DEVICE_RC_RNR_NAK_GEN		= (1 << 12),
> -	IB_DEVICE_SRQ_RESIZE			= (1 << 13),
> -	IB_DEVICE_N_NOTIFY_CQ			= (1 << 14),
> -
> -	/*
> -	 * 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_DEVICE_LOCAL_DMA_LKEY		= (1 << 15),
> -	IB_DEVICE_RESERVED /* old SEND_W_INV */	= (1 << 16),

Was this ever used by user-space? If so, I think there should be a 
comment saying that bit 16 is reserved, perhaps pointing to commit 
0f39cf3d54e6 ("IB/core: Add support for "send with invalidate" work 
requests").

> +	/*
> +	 * 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_UVERBS_DEVICE_LOCAL_DMA_LKEY		= (1 << 15),
I don't think user-space should be able to use local_dma_lkey.

Regards,
Haggai
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: start moving user space visible constants to uapi headers
       [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
                     ` (5 preceding siblings ...)
  2015-12-24 14:39   ` [PATCH 6/6] IB/uapi: expose device capability flags Christoph Hellwig
@ 2016-01-04 17:02   ` Steve Wise
  6 siblings, 0 replies; 18+ messages in thread
From: Steve Wise @ 2016-01-04 17:02 UTC (permalink / raw)
  To: Christoph Hellwig, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/24/2015 8:39 AM, Christoph Hellwig wrote:
> Currently very little of the uverbs user interface is actually exposed in
> uapi headers, and it's a constant struggle to figure out what's kernel
> internal and what is actually exposed in public.  This series starts
> sorting this out by creating the infrastructure for a uapi header shared
> between uverbs and the core IB stack, and starts moving all WR and WC
> constants as well as the device capabilitity flags there.
>
> A lot more work will have to follow, and I hope others will help out as
> well.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Series looks ok to me.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-01-04 17:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-24 14:39 start moving user space visible constants to uapi headers Christoph Hellwig
     [not found] ` <1450967967-12479-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-24 14:39   ` [PATCH 1/6] IB/uapi: expose uverbs WR opcodes Christoph Hellwig
     [not found]     ` <1450967967-12479-2-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-27  6:04       ` Leon Romanovsky
2015-12-24 14:39   ` [PATCH 2/6] IB/uapi: expose uverbs send WR flags Christoph Hellwig
     [not found]     ` <1450967967-12479-3-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-31 14:45       ` Haggai Eran
2015-12-24 14:39   ` [PATCH 3/6] IB/uapi: expose uverbs WC opcodes Christoph Hellwig
     [not found]     ` <1450967967-12479-4-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-27  6:12       ` Leon Romanovsky
     [not found]         ` <20151227061202.GB8501-2ukJVAZIZ/Y@public.gmane.org>
2015-12-29 11:02           ` Sagi Grimberg
     [not found]             ` <5682685E.90700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-30  9:44               ` Christoph Hellwig
     [not found]                 ` <20151230094429.GD12904-jcswGhMUV9g@public.gmane.org>
2015-12-30 11:28                   ` Leon Romanovsky
2015-12-24 14:39   ` [PATCH 4/6] IB/uapi: expose uverbs WC flags Christoph Hellwig
     [not found]     ` <1450967967-12479-5-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-27  6:15       ` Leon Romanovsky
     [not found]         ` <20151227061545.GC8501-2ukJVAZIZ/Y@public.gmane.org>
2015-12-29 11:04           ` Sagi Grimberg
2015-12-24 14:39   ` [PATCH 5/6] IB/uapi: expose uverbs WC status codes Christoph Hellwig
     [not found]     ` <1450967967-12479-6-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-27  6:17       ` Leon Romanovsky
2015-12-24 14:39   ` [PATCH 6/6] IB/uapi: expose device capability flags Christoph Hellwig
     [not found]     ` <1450967967-12479-7-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2015-12-31 15:17       ` Haggai Eran
2016-01-04 17:02   ` start moving user space visible constants to uapi headers Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).