linux-stable/net/sunrpc/xprtrdma
Chuck Lever 9c40c49f14 xprtrdma: Initialize separate RPC call and reply buffers
RPC-over-RDMA needs to separate its RPC call and reply buffers.

 o When an RPC Call is sent, rq_snd_buf is DMA mapped for an RDMA
   Send operation using DMA_TO_DEVICE

 o If the client expects a large RPC reply, it DMA maps rq_rcv_buf
   as part of a Reply chunk using DMA_FROM_DEVICE

The two mappings are for data movement in opposite directions.

DMA-API.txt suggests that if these mappings share a DMA cacheline,
bad things can happen. This could occur in the final bytes of
rq_snd_buf and the first bytes of rq_rcv_buf if the two buffers
happen to share a DMA cacheline.

On x86_64 the cacheline size is typically 8 bytes, and RPC call
messages are usually much smaller than the send buffer, so this
hasn't been a noticeable problem. But the DMA cacheline size can be
larger on other platforms.

Also, often rq_rcv_buf starts most of the way into a page, thus
an additional RDMA segment is needed to map and register the end of
that buffer. Try to avoid that scenario to reduce the cost of
registering and invalidating Reply chunks.

Instead of carrying a single regbuf that covers both rq_snd_buf and
rq_rcv_buf, each struct rpcrdma_req now carries one regbuf for
rq_snd_buf and one regbuf for rq_rcv_buf.

Some incidental changes worth noting:

- To clear out some spaghetti, refactor xprt_rdma_allocate.
- The value stored in rg_size is the same as the value stored in
  the iov.length field, so eliminate rg_size

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-09-19 13:08:37 -04:00
..
backchannel.c SUNRPC: Add a transport-specific private field in rpc_rqst 2016-09-19 13:08:37 -04:00
fmr_ops.c xprtrdma: Place registered MWs on a per-req list 2016-07-11 15:50:43 -04:00
frwr_ops.c xprtrdma: Place registered MWs on a per-req list 2016-07-11 15:50:43 -04:00
Makefile xprtrdma: Remove ALLPHYSICAL memory registration mode 2016-07-11 15:50:43 -04:00
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
rpc_rdma.c xprtrdma: Eliminate INLINE_THRESHOLD macros 2016-09-19 13:08:37 -04:00
svc_rdma.c svcrdma: Define maximum number of backchannel requests 2016-01-19 15:30:48 -05:00
svc_rdma_backchannel.c SUNRPC: Generalize the RPC buffer release API 2016-09-19 13:08:37 -04:00
svc_rdma_marshal.c svcrdma: Generalize svc_rdma_xdr_decode_req() 2016-05-13 15:53:06 -04:00
svc_rdma_recvfrom.c A very quiet cycle for nfsd, mainly just an RDMA update from Chuck Lever. 2016-05-24 14:39:20 -07:00
svc_rdma_sendto.c svcrdma: svc_rdma_put_context() is invoked twice in Send error path 2016-05-13 15:53:05 -04:00
svc_rdma_transport.c svcrdma: Drain QP before freeing svcrdma_xprt 2016-05-13 15:53:06 -04:00
transport.c xprtrdma: Initialize separate RPC call and reply buffers 2016-09-19 13:08:37 -04:00
verbs.c xprtrdma: Initialize separate RPC call and reply buffers 2016-09-19 13:08:37 -04:00
xprt_rdma.h xprtrdma: Initialize separate RPC call and reply buffers 2016-09-19 13:08:37 -04:00