Skip to contentSkip to conversation

xprtrdma: Add data types to support FRMR

RFC PATCH In review Tom Tucker 1 participant 1 message Aug 13, 2008

Subsystems (3)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

RFC PATCH 1/2 xprtrdma: Add data types to support FRMR

Add data types to support FRMR and a new memory registration strategy to use FRMR if available.

---
 include/linux/sunrpc/xprtrdma.h |    1 +
 net/sunrpc/xprtrdma/xprt_rdma.h |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
include/linux/sunrpc/xprtrdma.h +1 -0
index 4de56b1..98d8e4a 100644
@@ -79,6 +79,7 @@ enum rpcrdma_memreg {
 	RPCRDMA_MEMWINDOWS_ASYNC,
 	RPCRDMA_MTHCAFMR,
 	RPCRDMA_ALLPHYSICAL,
+	RPCRDMA_FASTREG,
 	RPCRDMA_LAST
 };
 
net/sunrpc/xprtrdma/xprt_rdma.h +9 -1
index 2427822..1f81dad 100644
@@ -58,6 +58,7 @@ struct rpcrdma_ia {
 	struct rdma_cm_id 	*ri_id;
 	struct ib_pd		*ri_pd;
 	struct ib_mr		*ri_bind_mem;
+	u32			ri_dma_lkey;
 	struct completion	ri_done;
 	int			ri_async_rc;
 	enum rpcrdma_memreg	ri_memreg_strategy;
@@ -159,6 +160,11 @@ struct rpcrdma_mr_seg {		/* chunk descriptors */
 			} r;
 			struct list_head mw_list;
 		} *rl_mw;
+		struct rpcrdma_frmr {
+			struct ib_fast_reg_page_list *fr_pgl;
+			struct ib_mr *fr_mr;
+			struct list_head fr_list;
+		} *rl_fr;
 	} mr_chunk;
 	u64		mr_base;	/* registration result */
 	u32		mr_rkey;	/* registration result */
@@ -198,7 +204,9 @@ struct rpcrdma_buffer {
 	atomic_t	rb_credits;	/* most recent server credits */
 	unsigned long	rb_cwndscale;	/* cached framework rpc_cwndscale */
 	int		rb_max_requests;/* client max requests */
-	struct list_head rb_mws;	/* optional memory windows/fmrs */
+	spinlock_t	rb_frs_lock;	/* protects frs list */
+	struct list_head rb_frs;	/* optional fmrs */
+	struct list_head rb_mws;	/* optional memory windows */
 	int		rb_send_index;
 	struct rpcrdma_req	**rb_send_bufs;
 	int		rb_recv_index;