linux/net/sunrpc/xprtrdma
Chuck Lever 54cbd6b0c6 xprtrdma: Delay DMA mapping Send and Receive buffers
Currently, each regbuf is allocated and DMA mapped at the same time.
This is done during transport creation.

When a device driver is unloaded, every DMA-mapped buffer in use by
a transport has to be unmapped, and then remapped to the new
device if the driver is loaded again. Remapping will have to be done
_after_ the connect worker has set up the new device.

But there's an ordering problem:

call_allocate, which invokes xprt_rdma_allocate which calls
rpcrdma_alloc_regbuf to allocate Send buffers, happens _before_
the connect worker can run to set up the new device.

Instead, at transport creation, allocate each buffer, but leave it
unmapped. Once the RPC carries these buffers into ->send_request, by
which time a transport connection should have been established,
check to see that the RPC's buffers have been DMA mapped. If not,
map them there.

When device driver unplug support is added, it will simply unmap all
the transport's regbufs, but it doesn't have to deallocate the
underlying memory.

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
..
Makefile xprtrdma: Remove ALLPHYSICAL memory registration mode 2016-07-11 15:50:43 -04:00
backchannel.c xprtrdma: Delay DMA mapping Send and Receive buffers 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
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
rpc_rdma.c xprtrdma: Delay DMA mapping Send and Receive buffers 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: Replace DMA_BIDIRECTIONAL 2016-09-19 13:08:37 -04:00
verbs.c xprtrdma: Delay DMA mapping Send and Receive buffers 2016-09-19 13:08:37 -04:00
xprt_rdma.h xprtrdma: Delay DMA mapping Send and Receive buffers 2016-09-19 13:08:37 -04:00