Skip to contentSkip to conversation

User library support for memory windows on rxe

PATCH Superseded Bob Pearson 1 participant 2 messages Aug 19, 2020 InfiniBand

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

This patch extends providers/rxe to support memory windows operations implemented by the matching kernel patch set.

#1 lore raw

PATCH 1/1 rdma-core/providers/rxe: Implement MW commands

Implemented
ibv_alloc_mw
ibv_dealloc_mw
ibv_bind_mw
post bind mw operations
post invalidate rkey commands
access MW and MR rkeys for RDMA write, read, and atomic

Depends on matching kernel patch set

---
 kernel-headers/rdma/rdma_user_rxe.h |  38 +++-
 providers/rxe/CMakeLists.txt        |   2 +
 providers/rxe/rxe-abi.h             |   4 +
 providers/rxe/rxe.c                 | 293 +++++--------------------
 providers/rxe/rxe.h                 |  44 ++++
 providers/rxe/rxe_mw.c              | 149 +++++++++++++
 providers/rxe/rxe_sq.c              | 319 ++++++++++++++++++++++++++++
 7 files changed, 613 insertions(+), 236 deletions(-)
 create mode 100644 providers/rxe/rxe_mw.c
 create mode 100644 providers/rxe/rxe_sq.c
kernel-headers/rdma/rdma_user_rxe.h +37 -1
index aae2e696..05fe8bef 100644
@@ -93,7 +93,33 @@ struct rxe_send_wr {
 			__u32	remote_qkey;
 			__u16	pkey_index;
 		} ud;
-		/* reg is only used by the kernel and is not part of the uapi */
+		struct {
+			__aligned_u64	addr;
+			__aligned_u64	length;
+			__u32	mr_index;
+			__u32   pad1;
+			__u32	mw_index;
+			__u32   pad2;
+			__u32	rkey;
+			__u32	access;
+			__u32	flags;
+		} umw;
+		/* below are only used by the kernel */
+		struct {
+			__aligned_u64	addr;
+			__aligned_u64	length;
+			union {
+				struct ib_mr	*ibmr;
+				__aligned_u64   reserved1;
+			};
+			union {
+				struct ib_mw	*ibmw;
+				__aligned_u64   reserved2;
+			};
+			__u32	rkey;
+			__u32	access;
+			__u32	flags;
+		} kmw;
 		struct {
 			union {
 				struct ib_mr *mr;
@@ -175,4 +201,14 @@ struct rxe_modify_srq_cmd {
 	__aligned_u64 mmap_info_addr;
 };
 
+struct rxe_reg_mr_resp {
+	__u32 index;
+	__u32 reserved;
+};
+
+struct rxe_alloc_mw_resp {
+	__u32 index;
+	__u32 reserved;
+};
+
 #endif /* RDMA_USER_RXE_H */
providers/rxe/CMakeLists.txt +2 -0
index d8f32651..ec4f005d 100644
@@ -1,3 +1,5 @@
 rdma_provider(rxe
   rxe.c
+  rxe_sq.c
+  rxe_mw.c
   )
providers/rxe/rxe-abi.h +4 -0
index b4680a24..2fc09483 100644
@@ -49,5 +49,9 @@ DECLARE_DRV_CMD(urxe_modify_srq, IB_USER_VERBS_CMD_MODIFY_SRQ,
 		rxe_modify_srq_cmd, empty);
 DECLARE_DRV_CMD(urxe_resize_cq, IB_USER_VERBS_CMD_RESIZE_CQ,
 		empty, rxe_resize_cq_resp);
+DECLARE_DRV_CMD(urxe_reg_mr, IB_USER_VERBS_CMD_REG_MR,
+		empty, rxe_reg_mr_resp);
+DECLARE_DRV_CMD(urxe_alloc_mw, IB_USER_VERBS_CMD_ALLOC_MW,
+		empty, rxe_alloc_mw_resp);
 
 #endif /* RXE_ABI_H */
providers/rxe/rxe.c +58 -235

452 lines not on this page · raw message

providers/rxe/rxe.h +44 -0

54 lines not on this page · raw message

providers/rxe/rxe_mw.c new file +149 -0

149 lines not on this page · raw message

providers/rxe/rxe_sq.c new file +319 -0

319 lines not on this page · raw message

Signature · 1 line
2.25.1