Skip to content

Commit c421ece

Browse files
chuckleveramschuma-ntap
authored andcommitted
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>
1 parent ef739b2 commit c421ece

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

net/sunrpc/xprtrdma/fmr_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
187187

188188
ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS /
189189
RPCRDMA_MAX_FMR_SGES);
190+
ia->ri_max_segs += 2; /* segments for head and tail buffers */
190191
return 0;
191192
}
192193

net/sunrpc/xprtrdma/frwr_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ frwr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep,
276276

277277
ia->ri_max_segs = max_t(unsigned int, 1, RPCRDMA_MAX_DATA_SEGS /
278278
ia->ri_max_frwr_depth);
279+
ia->ri_max_segs += 2; /* segments for head and tail buffers */
279280
return 0;
280281
}
281282

net/sunrpc/xprtrdma/rpc_rdma.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs)
7171
size = RPCRDMA_HDRLEN_MIN;
7272

7373
/* Maximum Read list size */
74-
maxsegs += 2; /* segment for head and tail buffers */
7574
size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);
7675

7776
/* Minimal Read chunk size */
@@ -97,7 +96,6 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs)
9796
size = RPCRDMA_HDRLEN_MIN;
9897

9998
/* Maximum Write list size */
100-
maxsegs += 2; /* segment for head and tail buffers */
10199
size = sizeof(__be32); /* segment count */
102100
size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);
103101
size += sizeof(__be32); /* list discriminator */

net/sunrpc/xprtrdma/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt)
10191019
LIST_HEAD(free);
10201020
LIST_HEAD(all);
10211021

1022-
for (count = 0; count < 3; count++) {
1022+
for (count = 0; count < ia->ri_max_segs; count++) {
10231023
struct rpcrdma_mr *mr;
10241024
int rc;
10251025

0 commit comments

Comments
 (0)