xprtrdma: Fix "bytes registered" accounting
authorChuck Lever <chuck.lever@oracle.com>
Wed, 3 Jan 2018 20:38:09 +0000 (15:38 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 23 Jan 2018 14:44:38 +0000 (09:44 -0500)
The contents of seg->mr_len changed when ->ro_map stopped returning
the full chunk length in the first segment. Count the full length of
each Write chunk, not the length of the first segment (which now can
only be as large as a page).

Fixes: 9d6b04097882 ("xprtrdma: Place registered MWs on a ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/rpc_rdma.c

index 1ae9b41..162e5dd 100644 (file)
@@ -431,7 +431,7 @@ rpcrdma_encode_write_list(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req,
 
                trace_xprtrdma_write_chunk(rqst->rq_task, mr, nsegs);
                r_xprt->rx_stats.write_chunk_count++;
-               r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+               r_xprt->rx_stats.total_rdma_request += mr->mr_length;
                nchunks++;
                nsegs -= mr->mr_nents;
        } while (nsegs);
@@ -489,7 +489,7 @@ rpcrdma_encode_reply_chunk(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req,
 
                trace_xprtrdma_reply_chunk(rqst->rq_task, mr, nsegs);
                r_xprt->rx_stats.reply_chunk_count++;
-               r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+               r_xprt->rx_stats.total_rdma_request += mr->mr_length;
                nchunks++;
                nsegs -= mr->mr_nents;
        } while (nsegs);