1
0
Fork 0
alistair23-linux/net/sunrpc/xprtrdma
Chuck Lever fcdfb968a7 xprtrdma: Use scatterlist for DMA mapping and unmapping under FMR
The use of a scatterlist for handling DMA mapping and unmapping
was recently introduced in frwr_ops.c in commit 4143f34e01
("xprtrdma: Port to new memory registration API"). That commit did
not make a similar update to xprtrdma's FMR support because the
core ib_map_phys_fmr() and ib_unmap_fmr() APIs have not been changed
to take a scatterlist argument.

However, FMR still needs to do DMA mapping and unmapping. It appears
that RDS, for example, uses a scatterlist for this, then builds the
DMA addr array for the ib_map_phys_fmr call separately. I see that
SRP also utilizes a scatterlist for DMA mapping. xprtrdma can do
something similar.

This modernization is used immediately to properly defer DMA
unmapping during fmr_unmap_safe (a FIXME). It separates the DMA
unmapping coordinates from the rl_segments array. This array, being
part of an rpcrdma_req, is always re-used immediately when an RPC
exits. A scatterlist is allocated in memory independent of the
rl_segments array, so it can be preserved indefinitely (ie, until
the MR invalidation and DMA unmapping can actually be done by a
worker thread).

The FRWR and FMR DMA mapping code are slightly different from each
other now, and will diverge further when the "Check for holes" logic
can be removed from FRWR (support for SG_GAP MRs). So I chose not to
create helpers for the common-looking code.

Fixes: ead3f26e35 ("xprtrdma: Add ro_unmap_safe memreg method")
Suggested-by: Sagi Grimberg <sagi@lightbits.io>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-07-11 15:50:43 -04:00
..
Makefile svcrdma: Add class for RDMA backwards direction transport 2016-01-19 15:30:48 -05:00
backchannel.c sunrpc: Advertise maximum backchannel payload size 2016-05-17 15:47:57 -04:00
fmr_ops.c xprtrdma: Use scatterlist for DMA mapping and unmapping under FMR 2016-07-11 15:50:43 -04:00
frwr_ops.c xprtrdma: Move init and release helpers 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
physical_ops.c xprtrdma: Remove ro_unmap() from all registration modes 2016-05-17 15:48:04 -04:00
rpc_rdma.c xprtrdma: Add ro_unmap_safe memreg method 2016-05-17 15:48:03 -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: 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: Add ro_unmap_safe memreg method 2016-05-17 15:48:03 -04:00
verbs.c xprtrdma: Remove qplock 2016-05-17 15:48:05 -04:00
xprt_rdma.h xprtrdma: Rename fields in rpcrdma_fmr 2016-07-11 15:50:43 -04:00