summaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-05-07 15:28:25 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-05-11 15:48:57 -0400
commit99722fe4d5a634707ced8d8f42b883b87a86b3c5 (patch)
treebc89587516be20f4c18330e63c28f087d8749896 /include/linux/sunrpc
parent3abb03facee06ea052be6e3a435f6dbb4e54fc04 (diff)
svcrdma: Persistently allocate and DMA-map Send buffers
While sending each RPC Reply, svc_rdma_sendto allocates and DMA- maps a separate buffer where the RPC/RDMA transport header is constructed. The buffer is unmapped and released in the Send completion handler. This is significant per-RPC overhead, especially for small RPCs. Instead, allocate and DMA-map a buffer, and cache it in each svc_rdma_send_ctxt. This buffer and its mapping can be re-used for each RPC, saving the cost of memory allocation and DMA mapping. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/svc_rdma.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index a8bfc214614b..96b14a72d359 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -162,6 +162,7 @@ struct svc_rdma_send_ctxt {
162 struct list_head sc_list; 162 struct list_head sc_list;
163 struct ib_send_wr sc_send_wr; 163 struct ib_send_wr sc_send_wr;
164 struct ib_cqe sc_cqe; 164 struct ib_cqe sc_cqe;
165 void *sc_xprt_buf;
165 int sc_page_count; 166 int sc_page_count;
166 int sc_cur_sge_no; 167 int sc_cur_sge_no;
167 struct page *sc_pages[RPCSVC_MAXPAGES]; 168 struct page *sc_pages[RPCSVC_MAXPAGES];
@@ -199,9 +200,12 @@ extern struct svc_rdma_send_ctxt *
199extern void svc_rdma_send_ctxt_put(struct svcxprt_rdma *rdma, 200extern void svc_rdma_send_ctxt_put(struct svcxprt_rdma *rdma,
200 struct svc_rdma_send_ctxt *ctxt); 201 struct svc_rdma_send_ctxt *ctxt);
201extern int svc_rdma_send(struct svcxprt_rdma *rdma, struct ib_send_wr *wr); 202extern int svc_rdma_send(struct svcxprt_rdma *rdma, struct ib_send_wr *wr);
202extern int svc_rdma_map_reply_hdr(struct svcxprt_rdma *rdma, 203extern void svc_rdma_sync_reply_hdr(struct svcxprt_rdma *rdma,
204 struct svc_rdma_send_ctxt *ctxt,
205 unsigned int len);
206extern int svc_rdma_map_reply_msg(struct svcxprt_rdma *rdma,
203 struct svc_rdma_send_ctxt *ctxt, 207 struct svc_rdma_send_ctxt *ctxt,
204 __be32 *rdma_resp, unsigned int len); 208 struct xdr_buf *xdr, __be32 *wr_lst);
205extern int svc_rdma_sendto(struct svc_rqst *); 209extern int svc_rdma_sendto(struct svc_rqst *);
206 210
207/* svc_rdma_transport.c */ 211/* svc_rdma_transport.c */