kernel_optimize_test/net/sunrpc/xprtrdma
Chuck Lever 821c791a0b xprtrdma: Segment head and tail XDR buffers on page boundaries
A single memory allocation is used for the pair of buffers wherein
the RPC client builds an RPC call message and decodes its matching
reply. These buffers are sized based on the maximum possible size
of the RPC call and reply messages for the operation in progress.

This means that as the call buffer increases in size, the start of
the reply buffer is pushed farther into the memory allocation.

RPC requests are growing in size. It used to be that both the call
and reply buffers fit inside a single page.

But these days, thanks to NFSv4 (and especially security labels in
NFSv4.2) the maximum call and reply sizes are large. NFSv4.0 OPEN,
for example, now requires a 6KB allocation for a pair of call and
reply buffers, and NFSv4 LOOKUP is not far behind.

As the maximum size of a call increases, the reply buffer is pushed
far enough into the buffer's memory allocation that a page boundary
can appear in the middle of it.

When the maximum possible reply size is larger than the client's
RDMA receive buffers (currently 1KB), the client has to register a
Reply chunk for the server to RDMA Write the reply into.

The logic in rpcrdma_convert_iovs() assumes that xdr_buf head and
tail buffers would always be contained on a single page. It supplies
just one segment for the head and one for the tail.

FMR, for example, registers up to a page boundary (only a portion of
the reply buffer in the OPEN case above). But without additional
segments, it doesn't register the rest of the buffer.

When the server tries to write the OPEN reply, the RDMA Write fails
with a remote access error since the client registered only part of
the Reply chunk.

rpcrdma_convert_iovs() must split the XDR buffer into multiple
segments, each of which are guaranteed not to contain a page
boundary. That way fmr_op_map is given the proper number of segments
to register the whole reply buffer.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Devesh Sharma <devesh.sharma@broadcom.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-03-14 14:55:53 -04:00
..
backchannel.c xprtrdma: rpcrdma_bc_receive_call() should init rq_private_buf.len 2016-02-17 10:23:52 -05:00
fmr_ops.c xprtrdma: Add ro_unmap_sync method for FMR 2015-12-18 15:34:33 -05:00
frwr_ops.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08: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: Clean up physical_op_map() 2016-03-14 14:55:47 -04:00
rpc_rdma.c xprtrdma: Segment head and tail XDR buffers on page boundaries 2016-03-14 14:55:53 -04:00
svc_rdma_backchannel.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma_marshal.c svcrdma: Keep rpcrdma_msg fields in network byte-order 2015-06-04 16:55:59 -04:00
svc_rdma_recvfrom.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma_sendto.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma_transport.c svc_rdma: use local_dma_lkey 2016-01-19 15:30:48 -05:00
svc_rdma.c svcrdma: Define maximum number of backchannel requests 2016-01-19 15:30:48 -05:00
transport.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
verbs.c Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
xprt_rdma.h Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00