* [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: 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