linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: [PATCH v2 17/18] xprtrdma: Remove ro_unmap() from all registration modes
Date: Mon, 25 Apr 2016 15:23:07 -0400	[thread overview]
Message-ID: <20160425192307.3566.96703.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20160425185956.3566.64142.stgit@manet.1015granger.net>

Clean up: The ro_unmap method is no longer used.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/fmr_ops.c      |   31 --------------------------
 net/sunrpc/xprtrdma/frwr_ops.c     |   43 ------------------------------------
 net/sunrpc/xprtrdma/physical_ops.c |   12 ----------
 net/sunrpc/xprtrdma/xprt_rdma.h    |    2 --
 4 files changed, 88 deletions(-)

diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c
index a658dcf..6326ebe 100644
--- a/net/sunrpc/xprtrdma/fmr_ops.c
+++ b/net/sunrpc/xprtrdma/fmr_ops.c
@@ -328,36 +328,6 @@ fmr_op_unmap_safe(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req,
 	}
 }
 
-/* Use the ib_unmap_fmr() verb to prevent further remote
- * access via RDMA READ or RDMA WRITE.
- */
-static int
-fmr_op_unmap(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr_seg *seg)
-{
-	struct rpcrdma_ia *ia = &r_xprt->rx_ia;
-	struct rpcrdma_mr_seg *seg1 = seg;
-	struct rpcrdma_mw *mw = seg1->rl_mw;
-	int rc, nsegs = seg->mr_nsegs;
-
-	dprintk("RPC:       %s: FMR %p\n", __func__, mw);
-
-	seg1->rl_mw = NULL;
-	while (seg1->mr_nsegs--)
-		rpcrdma_unmap_one(ia->ri_device, seg++);
-	rc = __fmr_unmap(mw);
-	if (rc)
-		goto out_err;
-	rpcrdma_put_mw(r_xprt, mw);
-	return nsegs;
-
-out_err:
-	/* The FMR is abandoned, but remains in rb_all. fmr_op_destroy
-	 * will attempt to release it when the transport is destroyed.
-	 */
-	dprintk("RPC:       %s: ib_unmap_fmr status %i\n", __func__, rc);
-	return nsegs;
-}
-
 static void
 fmr_op_destroy(struct rpcrdma_buffer *buf)
 {
@@ -382,7 +352,6 @@ const struct rpcrdma_memreg_ops rpcrdma_fmr_memreg_ops = {
 	.ro_map				= fmr_op_map,
 	.ro_unmap_sync			= fmr_op_unmap_sync,
 	.ro_unmap_safe			= fmr_op_unmap_safe,
-	.ro_unmap			= fmr_op_unmap,
 	.ro_open			= fmr_op_open,
 	.ro_maxpages			= fmr_op_maxpages,
 	.ro_init			= fmr_op_init,
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index 79ba323..a192b91 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -640,48 +640,6 @@ frwr_op_unmap_safe(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req,
 	}
 }
 
-/* Post a LOCAL_INV Work Request to prevent further remote access
- * via RDMA READ or RDMA WRITE.
- */
-static int
-frwr_op_unmap(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr_seg *seg)
-{
-	struct rpcrdma_mr_seg *seg1 = seg;
-	struct rpcrdma_ia *ia = &r_xprt->rx_ia;
-	struct rpcrdma_mw *mw = seg1->rl_mw;
-	struct rpcrdma_frmr *frmr = &mw->frmr;
-	struct ib_send_wr *invalidate_wr, *bad_wr;
-	int rc, nsegs = seg->mr_nsegs;
-
-	dprintk("RPC:       %s: FRMR %p\n", __func__, mw);
-
-	seg1->rl_mw = NULL;
-	frmr->fr_state = FRMR_IS_INVALID;
-	invalidate_wr = &mw->frmr.fr_invwr;
-
-	memset(invalidate_wr, 0, sizeof(*invalidate_wr));
-	frmr->fr_cqe.done = frwr_wc_localinv;
-	invalidate_wr->wr_cqe = &frmr->fr_cqe;
-	invalidate_wr->opcode = IB_WR_LOCAL_INV;
-	invalidate_wr->ex.invalidate_rkey = frmr->fr_mr->rkey;
-	DECR_CQCOUNT(&r_xprt->rx_ep);
-
-	ib_dma_unmap_sg(ia->ri_device, frmr->fr_sg, frmr->fr_nents, frmr->fr_dir);
-	read_lock(&ia->ri_qplock);
-	rc = ib_post_send(ia->ri_id->qp, invalidate_wr, &bad_wr);
-	read_unlock(&ia->ri_qplock);
-	if (rc)
-		goto out_err;
-
-	rpcrdma_put_mw(r_xprt, mw);
-	return nsegs;
-
-out_err:
-	dprintk("RPC:       %s: ib_post_send status %i\n", __func__, rc);
-	__frwr_queue_recovery(mw);
-	return nsegs;
-}
-
 static void
 frwr_op_destroy(struct rpcrdma_buffer *buf)
 {
@@ -702,7 +660,6 @@ const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops = {
 	.ro_map				= frwr_op_map,
 	.ro_unmap_sync			= frwr_op_unmap_sync,
 	.ro_unmap_safe			= frwr_op_unmap_safe,
-	.ro_unmap			= frwr_op_unmap,
 	.ro_open			= frwr_op_open,
 	.ro_maxpages			= frwr_op_maxpages,
 	.ro_init			= frwr_op_init,
diff --git a/net/sunrpc/xprtrdma/physical_ops.c b/net/sunrpc/xprtrdma/physical_ops.c
index 95ef3a7..3750596 100644
--- a/net/sunrpc/xprtrdma/physical_ops.c
+++ b/net/sunrpc/xprtrdma/physical_ops.c
@@ -74,17 +74,6 @@ physical_op_map(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr_seg *seg,
 	return 1;
 }
 
-/* Unmap a memory region, but leave it registered.
- */
-static int
-physical_op_unmap(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr_seg *seg)
-{
-	struct rpcrdma_ia *ia = &r_xprt->rx_ia;
-
-	rpcrdma_unmap_one(ia->ri_device, seg);
-	return 1;
-}
-
 /* DMA unmap all memory regions that were mapped for "req".
  */
 static void
@@ -125,7 +114,6 @@ const struct rpcrdma_memreg_ops rpcrdma_physical_memreg_ops = {
 	.ro_map				= physical_op_map,
 	.ro_unmap_sync			= physical_op_unmap_sync,
 	.ro_unmap_safe			= physical_op_unmap_safe,
-	.ro_unmap			= physical_op_unmap,
 	.ro_open			= physical_op_open,
 	.ro_maxpages			= physical_op_maxpages,
 	.ro_init			= physical_op_init,
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index 04a7058..24bbea4 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -397,8 +397,6 @@ struct rpcrdma_memreg_ops {
 				  struct rpcrdma_mr_seg *, int, bool);
 	void		(*ro_unmap_sync)(struct rpcrdma_xprt *,
 					 struct rpcrdma_req *);
-	int		(*ro_unmap)(struct rpcrdma_xprt *,
-				    struct rpcrdma_mr_seg *);
 	void		(*ro_unmap_safe)(struct rpcrdma_xprt *,
 					 struct rpcrdma_req *, bool);
 	int		(*ro_open)(struct rpcrdma_ia *,


  parent reply	other threads:[~2016-04-25 19:23 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 19:20 [PATCH v2 00/18] NFS/RDMA client patches for v4.7 Chuck Lever
2016-04-25 19:20 ` [PATCH v2 01/18] sunrpc: Advertise maximum backchannel payload size Chuck Lever
2016-04-25 19:21 ` [PATCH v2 02/18] xprtrdma: Bound the inline threshold values Chuck Lever
2016-04-25 19:21 ` [PATCH v2 03/18] xprtrdma: Limit number of RDMA segments in RPC-over-RDMA headers Chuck Lever
2016-04-26 19:43   ` Sagi Grimberg
2016-04-25 19:21 ` [PATCH v2 04/18] xprtrdma: Prevent inline overflow Chuck Lever
2016-04-26 19:55   ` Sagi Grimberg
2016-04-26 20:04     ` Chuck Lever
2016-04-26 20:42       ` Sagi Grimberg
2016-04-26 20:56         ` Chuck Lever
2016-04-25 19:21 ` [PATCH v2 05/18] xprtrdma: Avoid using Write list for small NFS READ requests Chuck Lever
2016-04-26 19:56   ` Sagi Grimberg
2016-04-25 19:21 ` [PATCH v2 06/18] xprtrdma: Update comments in rpcrdma_marshal_req() Chuck Lever
2016-04-26 19:57   ` Sagi Grimberg
2016-04-25 19:21 ` [PATCH v2 07/18] xprtrdma: Allow Read list and Reply chunk simultaneously Chuck Lever
2016-04-26 20:04   ` Sagi Grimberg
2016-04-25 19:21 ` [PATCH v2 08/18] xprtrdma: Remove rpcrdma_create_chunks() Chuck Lever
2016-04-26 20:04   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 09/18] xprtrdma: Use core ib_drain_qp() API Chuck Lever
2016-04-26 20:07   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 10/18] xprtrdma: Rename rpcrdma_frwr::sg and sg_nents Chuck Lever
2016-04-26 20:08   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 11/18] xprtrdma: Save I/O direction in struct rpcrdma_frwr Chuck Lever
2016-04-26 20:12   ` Sagi Grimberg
2016-04-26 20:14     ` Chuck Lever
2016-04-25 19:22 ` [PATCH v2 12/18] xprtrdma: Reset MRs in frwr_op_unmap_sync() Chuck Lever
2016-04-26 20:13   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 13/18] xprtrdma: Refactor the FRWR recovery worker Chuck Lever
2016-04-26 20:16   ` Sagi Grimberg
2016-04-26 20:30     ` Chuck Lever
2016-04-26 20:33       ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 14/18] xprtrdma: Move fr_xprt and fr_worker to struct rpcrdma_mw Chuck Lever
2016-04-26 20:18   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 15/18] xprtrdma: Refactor __fmr_dma_unmap() Chuck Lever
2016-04-26 20:21   ` Sagi Grimberg
2016-04-25 19:22 ` [PATCH v2 16/18] xprtrdma: Add ro_unmap_safe memreg method Chuck Lever
2016-04-26 20:26   ` Sagi Grimberg
2016-04-26 20:44     ` Chuck Lever
2016-04-27 15:59       ` Removing NFS/RDMA client support for PHYSICAL memory registration Chuck Lever
2016-04-28 10:59         ` Sagi Grimberg
2016-04-25 19:23 ` Chuck Lever [this message]
2016-04-26 20:29   ` [PATCH v2 17/18] xprtrdma: Remove ro_unmap() from all registration modes Sagi Grimberg
2016-04-26 20:46     ` Chuck Lever
2016-04-26 20:50       ` Sagi Grimberg
2016-04-25 19:23 ` [PATCH v2 18/18] xprtrdma: Faster server reboot recovery Chuck Lever
2016-04-26 20:31   ` Sagi Grimberg
2016-04-26 14:13 ` [PATCH v2 00/18] NFS/RDMA client patches for v4.7 Steve Wise
2016-04-26 14:57   ` Chuck Lever
2016-04-26 16:45     ` Steve Wise
2016-04-26 17:15       ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160425192307.3566.96703.stgit@manet.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).