linux/net/sunrpc/xprtrdma
Chuck Lever 94f58c58c0 xprtrdma: Allow Read list and Reply chunk simultaneously
rpcrdma_marshal_req() makes a simplifying assumption: that NFS
operations with large Call messages have small Reply messages, and
vice versa. Therefore with RPC-over-RDMA, only one chunk type is
ever needed for each Call/Reply pair, because one direction needs
chunks, the other direction will always fit inline.

In fact, this assumption is asserted in the code:

  if (rtype != rpcrdma_noch && wtype != rpcrdma_noch) {
  	dprintk("RPC:       %s: cannot marshal multiple chunk lists\n",
		__func__);
	return -EIO;
  }

But RPCGSS_SEC breaks this assumption. Because krb5i and krb5p
perform data transformation on RPC messages before they are
transmitted, direct data placement techniques cannot be used, thus
RPC messages must be sent via a Long call in both directions.
All such calls are sent with a Position Zero Read chunk, and all
such replies are handled with a Reply chunk. Thus the client must
provide every Call/Reply pair with both a Read list and a Reply
chunk.

Without any special security in effect, NFSv4 WRITEs may now also
use the Read list and provide a Reply chunk. The marshal_req
logic was preventing that, meaning an NFSv4 WRITE with a large
payload that included a GETATTR result larger than the inline
threshold would fail.

The code that encodes each chunk list is now completely contained in
its own function. There is some code duplication, but the trade-off
is that the overall logic should be more clear.

Note that all three chunk lists now share the rl_segments array.
Some additional per-req accounting is necessary to track this
usage. For the same reasons that the above simplifying assumption
has held true for so long, I don't expect more array elements are
needed at this time.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 15:47:59 -04:00
..
backchannel.c sunrpc: Advertise maximum backchannel payload size 2016-05-17 15:47:57 -04:00
fmr_ops.c xprtrdma: Prevent inline overflow 2016-05-17 15:47:58 -04:00
frwr_ops.c xprtrdma: Prevent inline overflow 2016-05-17 15:47:58 -04:00
Makefile svcrdma: Add class for RDMA backwards direction transport 2016-01-19 15:30:48 -05:00
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
physical_ops.c xprtrdma: Prevent inline overflow 2016-05-17 15:47:58 -04:00
rpc_rdma.c xprtrdma: Allow Read list and Reply chunk simultaneously 2016-05-17 15:47:59 -04:00
svc_rdma.c svcrdma: Define maximum number of backchannel requests 2016-01-19 15:30:48 -05:00
svc_rdma_backchannel.c svcrdma: Use new CQ API for RPC-over-RDMA server send CQs 2016-03-01 13:06:43 -08:00
svc_rdma_marshal.c svcrdma: Hook up the logic to return ERR_CHUNK 2016-03-01 13:06:40 -08:00
svc_rdma_recvfrom.c svcrdma: Use new CQ API for RPC-over-RDMA server send CQs 2016-03-01 13:06:43 -08:00
svc_rdma_sendto.c svcrdma: Use new CQ API for RPC-over-RDMA server send CQs 2016-03-01 13:06:43 -08:00
svc_rdma_transport.c svcrdma: Use new CQ API for RPC-over-RDMA server send CQs 2016-03-01 13:06:43 -08:00
transport.c xprtrdma: Bound the inline threshold values 2016-05-17 15:47:57 -04:00
verbs.c xprtrdma: Limit number of RDMA segments in RPC-over-RDMA headers 2016-05-17 15:47:58 -04:00
xprt_rdma.h xprtrdma: Allow Read list and Reply chunk simultaneously 2016-05-17 15:47:59 -04:00