aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-10-01 14:25:20 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-10-02 15:46:35 -0400
commitc421ece68f6952d4cc48ee81ebfc61ef0b83ad3b (patch)
treea49b769da04cd15ee23a2dd381acc9cea1698465 /net
parentef739b2175dde9c05594f768cb78149f1ce2ac36 (diff)
xprtrdma: Create more MRs at a time
Some devices require more than 3 MRs to build a single 1MB I/O. Ensure that rpcrdma_mrs_create() will add enough MRs to build that I/O. In a subsequent patch I'm changing the MR recovery logic to just toss out the MRs. In that case it's possible for ->send_request to loop acquiring some MRs, not getting enough, getting called again, recycling the previous MRs, then not getting enough, lather rinse repeat. Thus first we need to ensure enough MRs are created to prevent that loop. I'm "reusing" ia->ri_max_segs. All of its accessors seem to want the maximum number of data segments plus two, so I'm going to bake that into the initial calculation. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtrdma/fmr_ops.c1
-rw-r--r--net/sunrpc/xprtrdma/frwr_ops.c1
-rw-r--r--net/sunrpc/xprtrdma/rpc_rdma.c2
-rw-r--r--net/sunrpc/xprtrdma/verbs.c2
4 files changed, 3 insertions, 3 deletions
diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c
index 0f7c465d9a5a..db589a23682b 100644
--- a/net/sunrpc/xprtrdma/fmr_ops.c
+++ b/net/sunrpc/xprtrdma/fmr_ops.c
@@ -187,6 +187,7 @@ fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
187 187
188 ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS / 188 ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS /
189 RPCRDMA_MAX_FMR_SGES); 189 RPCRDMA_MAX_FMR_SGES);
190 ia->ri_max_segs += 2; /* segments for head and tail buffers */
190 return 0; 191 return 0;
191} 192}
192 193
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index 1bb00dd6ccdb..1cc4db515c85 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -276,6 +276,7 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
276 276
277 ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS / 277 ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS /
278 ia->ri_max_frwr_depth); 278 ia->ri_max_frwr_depth);
279 ia->ri_max_segs += 2; /* segments for head and tail buffers */
279 return 0; 280 return 0;
280} 281}
281 282
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index 293b3d3e3e65..15edc050ca93 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -71,7 +71,6 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs)
71 size = RPCRDMA_HDRLEN_MIN; 71 size = RPCRDMA_HDRLEN_MIN;
72 72
73 /* Maximum Read list size */ 73 /* Maximum Read list size */
74 maxsegs += 2; /* segment for head and tail buffers */
75 size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32); 74 size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);
76 75
77 /* Minimal Read chunk size */ 76 /* Minimal Read chunk size */
@@ -97,7 +96,6 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs)
97 size = RPCRDMA_HDRLEN_MIN; 96 size = RPCRDMA_HDRLEN_MIN;
98 97
99 /* Maximum Write list size */ 98 /* Maximum Write list size */
100 maxsegs += 2; /* segment for head and tail buffers */
101 size = sizeof(__be32); /* segment count */ 99 size = sizeof(__be32); /* segment count */
102 size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32); 100 size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);
103 size += sizeof(__be32); /* list discriminator */ 101 size += sizeof(__be32); /* list discriminator */
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 956a5ea47b58..5625a5089f96 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1019,7 +1019,7 @@ rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt)
1019 LIST_HEAD(free); 1019 LIST_HEAD(free);
1020 LIST_HEAD(all); 1020 LIST_HEAD(all);
1021 1021
1022 for (count = 0; count < 3; count++) { 1022 for (count = 0; count < ia->ri_max_segs; count++) {
1023 struct rpcrdma_mr *mr; 1023 struct rpcrdma_mr *mr;
1024 int rc; 1024 int rc;
1025 1025