aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTom Tucker <tom@opengridcomputing.com>2008-09-30 14:06:13 -0400
committerTom Tucker <tom@opengridcomputing.com>2008-10-03 16:39:58 -0400
commit0d3ebb9ae9f9c887518fd4c81a68084111d154d7 (patch)
treedd6e68bb5f9f25c1c212fec567ba68e13d214e58 /include
parentbc45eb8950b8c14487385cfd2bda1613ca8d9703 (diff)
svcrdma: Add Fast Reg MR Data Types
Add data types to track Fast Reg Memory Regions. The core data type is svc_rdma_fastreg_mr that associates a device MR with a host kva and page list. A field is added to the WR context to keep track of the FRMR used to map the local memory for an RPC. An FRMR list and spin lock are added to the transport instance to keep track of all FRMR allocated for the transport. Also added are device capability flags to indicate what the memory registration capabilities are for the underlying device and whether or not fast memory registration is supported. Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/svc_rdma.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index dc05b54bd3a3..49e458d98945 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -72,6 +72,7 @@ extern atomic_t rdma_stat_sq_prod;
72 */ 72 */
73struct svc_rdma_op_ctxt { 73struct svc_rdma_op_ctxt {
74 struct svc_rdma_op_ctxt *read_hdr; 74 struct svc_rdma_op_ctxt *read_hdr;
75 struct svc_rdma_fastreg_mr *frmr;
75 int hdr_count; 76 int hdr_count;
76 struct xdr_buf arg; 77 struct xdr_buf arg;
77 struct list_head dto_q; 78 struct list_head dto_q;
@@ -103,16 +104,30 @@ struct svc_rdma_chunk_sge {
103 int start; /* sge no for this chunk */ 104 int start; /* sge no for this chunk */
104 int count; /* sge count for this chunk */ 105 int count; /* sge count for this chunk */
105}; 106};
107struct svc_rdma_fastreg_mr {
108 struct ib_mr *mr;
109 void *kva;
110 struct ib_fast_reg_page_list *page_list;
111 int page_list_len;
112 unsigned long access_flags;
113 unsigned long map_len;
114 enum dma_data_direction direction;
115 struct list_head frmr_list;
116};
106struct svc_rdma_req_map { 117struct svc_rdma_req_map {
118 struct svc_rdma_fastreg_mr *frmr;
107 unsigned long count; 119 unsigned long count;
108 union { 120 union {
109 struct kvec sge[RPCSVC_MAXPAGES]; 121 struct kvec sge[RPCSVC_MAXPAGES];
110 struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES]; 122 struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES];
111 }; 123 };
112}; 124};
113 125#define RDMACTXT_F_FAST_UNREG 1
114#define RDMACTXT_F_LAST_CTXT 2 126#define RDMACTXT_F_LAST_CTXT 2
115 127
128#define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */
129#define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */
130
116struct svcxprt_rdma { 131struct svcxprt_rdma {
117 struct svc_xprt sc_xprt; /* SVC transport structure */ 132 struct svc_xprt sc_xprt; /* SVC transport structure */
118 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ 133 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */
@@ -136,6 +151,11 @@ struct svcxprt_rdma {
136 struct ib_cq *sc_rq_cq; 151 struct ib_cq *sc_rq_cq;
137 struct ib_cq *sc_sq_cq; 152 struct ib_cq *sc_sq_cq;
138 struct ib_mr *sc_phys_mr; /* MR for server memory */ 153 struct ib_mr *sc_phys_mr; /* MR for server memory */
154 u32 sc_dev_caps; /* distilled device caps */
155 u32 sc_dma_lkey; /* local dma key */
156 unsigned int sc_frmr_pg_list_len;
157 struct list_head sc_frmr_q;
158 spinlock_t sc_frmr_q_lock;
139 159
140 spinlock_t sc_lock; /* transport lock */ 160 spinlock_t sc_lock; /* transport lock */
141 161