aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2015-07-27 19:10:12 -0400
committerDoug Ledford <dledford@redhat.com>2015-08-28 23:02:11 -0400
commitbc3fe2e3769874dfa8674791e84c4a901ba9e48b (patch)
tree75da57633763835d55b333cd92f9b18728304853 /net/sunrpc
parentaaae91f4f05c39f02e36e89b00ad84465f8eb02b (diff)
svcrdma: Use max_sge_rd for destination read depths
Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_recvfrom.c12
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c4
2 files changed, 5 insertions, 11 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index 2e1348bde325..cb5174284074 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -115,15 +115,6 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
115 rqstp->rq_arg.tail[0].iov_len = 0; 115 rqstp->rq_arg.tail[0].iov_len = 0;
116} 116}
117 117
118static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
119{
120 if (!rdma_cap_read_multi_sge(xprt->sc_cm_id->device,
121 xprt->sc_cm_id->port_num))
122 return 1;
123 else
124 return min_t(int, sge_count, xprt->sc_max_sge);
125}
126
127/* Issue an RDMA_READ using the local lkey to map the data sink */ 118/* Issue an RDMA_READ using the local lkey to map the data sink */
128int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt, 119int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
129 struct svc_rqst *rqstp, 120 struct svc_rqst *rqstp,
@@ -144,8 +135,7 @@ int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
144 135
145 ctxt->direction = DMA_FROM_DEVICE; 136 ctxt->direction = DMA_FROM_DEVICE;
146 ctxt->read_hdr = head; 137 ctxt->read_hdr = head;
147 pages_needed = 138 pages_needed = min_t(int, pages_needed, xprt->sc_max_sge_rd);
148 min_t(int, pages_needed, rdma_read_max_sge(xprt, pages_needed));
149 read = min_t(int, pages_needed << PAGE_SHIFT, rs_length); 139 read = min_t(int, pages_needed << PAGE_SHIFT, rs_length);
150 140
151 for (pno = 0; pno < pages_needed; pno++) { 141 for (pno = 0; pno < pages_needed; pno++) {
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 6b36279e4288..fdc850ffc26c 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -872,6 +872,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
872 * capabilities of this particular device */ 872 * capabilities of this particular device */
873 newxprt->sc_max_sge = min((size_t)devattr.max_sge, 873 newxprt->sc_max_sge = min((size_t)devattr.max_sge,
874 (size_t)RPCSVC_MAXPAGES); 874 (size_t)RPCSVC_MAXPAGES);
875 newxprt->sc_max_sge_rd = min_t(size_t, devattr.max_sge_rd,
876 RPCSVC_MAXPAGES);
875 newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr, 877 newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr,
876 (size_t)svcrdma_max_requests); 878 (size_t)svcrdma_max_requests);
877 newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests; 879 newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests;
@@ -1046,6 +1048,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
1046 " remote_ip : %pI4\n" 1048 " remote_ip : %pI4\n"
1047 " remote_port : %d\n" 1049 " remote_port : %d\n"
1048 " max_sge : %d\n" 1050 " max_sge : %d\n"
1051 " max_sge_rd : %d\n"
1049 " sq_depth : %d\n" 1052 " sq_depth : %d\n"
1050 " max_requests : %d\n" 1053 " max_requests : %d\n"
1051 " ord : %d\n", 1054 " ord : %d\n",
@@ -1059,6 +1062,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
1059 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1062 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1060 route.addr.dst_addr)->sin_port), 1063 route.addr.dst_addr)->sin_port),
1061 newxprt->sc_max_sge, 1064 newxprt->sc_max_sge,
1065 newxprt->sc_max_sge_rd,
1062 newxprt->sc_sq_depth, 1066 newxprt->sc_sq_depth,
1063 newxprt->sc_max_requests, 1067 newxprt->sc_max_requests,
1064 newxprt->sc_ord); 1068 newxprt->sc_ord);