diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-08 18:22:18 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-08 18:22:18 -0400 |
commit | 107e0008dfb8bd6366bc8827f5bbbc0c1f795d2d (patch) | |
tree | 12d6be652e3de5cfcfcec5fe0bc37e4b1d983b44 /include | |
parent | 2937391385807b3da9cd7a39345259caf550b032 (diff) | |
parent | 67080c82361b7510b602c87b83399421aa2d2895 (diff) |
Merge branch 'from-tomtucker' into for-2.6.28
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/svc_rdma.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index dc05b54bd3a3..c14fe86dac59 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 | */ |
73 | struct svc_rdma_op_ctxt { | 73 | struct 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 | }; |
107 | struct 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 | }; | ||
106 | struct svc_rdma_req_map { | 117 | struct 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 | |||
116 | struct svcxprt_rdma { | 131 | struct 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 | ||
@@ -192,8 +212,13 @@ extern int svc_rdma_post_recv(struct svcxprt_rdma *); | |||
192 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); | 212 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); |
193 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); | 213 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); |
194 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); | 214 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); |
215 | extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt); | ||
195 | extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); | 216 | extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); |
196 | extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); | 217 | extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); |
218 | extern int svc_rdma_fastreg(struct svcxprt_rdma *, struct svc_rdma_fastreg_mr *); | ||
219 | extern struct svc_rdma_fastreg_mr *svc_rdma_get_frmr(struct svcxprt_rdma *); | ||
220 | extern void svc_rdma_put_frmr(struct svcxprt_rdma *, | ||
221 | struct svc_rdma_fastreg_mr *); | ||
197 | extern void svc_sq_reap(struct svcxprt_rdma *); | 222 | extern void svc_sq_reap(struct svcxprt_rdma *); |
198 | extern void svc_rq_reap(struct svcxprt_rdma *); | 223 | extern void svc_rq_reap(struct svcxprt_rdma *); |
199 | extern struct svc_xprt_class svc_rdma_class; | 224 | extern struct svc_xprt_class svc_rdma_class; |