summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma/frwr_ops.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2017-12-15 02:56:26 +0100
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-01-16 17:19:43 +0100
commitc34416182f041e4107e531c6083c3df9a8af96f7 (patch)
tree8be10f4a84bf332e67a3bae69077c0c07baf8f80 /net/sunrpc/xprtrdma/frwr_ops.c
parentxprtrdma: Eliminate unnecessary lock cycle in xprt_rdma_send_request (diff)
downloadlinux-c34416182f041e4107e531c6083c3df9a8af96f7.tar.xz
linux-c34416182f041e4107e531c6083c3df9a8af96f7.zip
xprtrdma: Per-mode handling for Remote Invalidation
Refactoring change: Remote Invalidation is particular to the memory registration mode that is use. Use a callout instead of a generic function to handle Remote Invalidation. This gets rid of the 8-byte flags field in struct rpcrdma_mw, of which only a single bit flag has been allocated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/frwr_ops.c')
-rw-r--r--net/sunrpc/xprtrdma/frwr_ops.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index 773e66e10a15..e1f73037b554 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -450,6 +450,26 @@ out_senderr:
return ERR_PTR(-ENOTCONN);
}
+/* Handle a remotely invalidated mw on the @mws list
+ */
+static void
+frwr_op_reminv(struct rpcrdma_rep *rep, struct list_head *mws)
+{
+ struct rpcrdma_mw *mw;
+
+ list_for_each_entry(mw, mws, mw_list)
+ if (mw->mw_handle == rep->rr_inv_rkey) {
+ struct rpcrdma_xprt *r_xprt = mw->mw_xprt;
+
+ list_del(&mw->mw_list);
+ mw->frmr.fr_state = FRMR_IS_INVALID;
+ ib_dma_unmap_sg(r_xprt->rx_ia.ri_device,
+ mw->mw_sg, mw->mw_nents, mw->mw_dir);
+ rpcrdma_put_mw(r_xprt, mw);
+ break; /* only one invalidated MR per RPC */
+ }
+}
+
/* Invalidate all memory regions that were registered for "req".
*
* Sleeps until it is safe for the host CPU to access the
@@ -478,9 +498,6 @@ frwr_op_unmap_sync(struct rpcrdma_xprt *r_xprt, struct list_head *mws)
list_for_each_entry(mw, mws, mw_list) {
mw->frmr.fr_state = FRMR_IS_INVALID;
- if (mw->mw_flags & RPCRDMA_MW_F_RI)
- continue;
-
f = &mw->frmr;
dprintk("RPC: %s: invalidating frmr %p\n",
__func__, f);
@@ -553,6 +570,7 @@ reset_mrs:
const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops = {
.ro_map = frwr_op_map,
+ .ro_reminv = frwr_op_reminv,
.ro_unmap_sync = frwr_op_unmap_sync,
.ro_recover_mr = frwr_op_recover_mr,
.ro_open = frwr_op_open,