xprtrdma: Fix ri_max_segs and the result of ro_maxpages
authorChuck Lever <chuck.lever@oracle.com>
Wed, 19 Dec 2018 15:58:45 +0000 (10:58 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 2 Jan 2019 17:05:16 +0000 (12:05 -0500)
commit6946f82380a83acb7023fab9d7033e1f016cb818
tree7d51a409449063340b5638c571af01ce32b614b1
parent0c0829bcf51aef713806e49b8ea2bac7962f54e2
xprtrdma: Fix ri_max_segs and the result of ro_maxpages

With certain combinations of krb5i/p, MR size, and r/wsize, I/O can
fail with EMSGSIZE. This is because the calculated value of
ri_max_segs (the max number of MRs per RPC) exceeded
RPCRDMA_MAX_HDR_SEGS, which caused Read or Write list encoding to
walk off the end of the transport header.

Once that was addressed, the ro_maxpages result has to be corrected
to account for the number of MRs needed for Reply chunks, which is
2 MRs smaller than a normal Read or Write chunk.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/fmr_ops.c
net/sunrpc/xprtrdma/frwr_ops.c
net/sunrpc/xprtrdma/transport.c