diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2015-01-21 11:02:54 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2015-01-30 10:47:48 -0500 |
commit | 3eb358106660195948f4e95822039c5799fc41f8 (patch) | |
tree | c7a52b3fe52084019ad2e61a4f44cc90967b0ab3 | |
parent | 5d410ba061c1e4bc0068ce91f2cf349998cde46c (diff) |
xprtrdma: Remove rl_mr field, and the mr_chunk union
Clean up: Since commit 0ac531c18323 ("xprtrdma: Remove REGISTER
memory registration mode"), the rl_mr pointer is no longer used
anywhere.
After removal, there's only a single member of the mr_chunk union,
so mr_chunk can be removed as well, in favor of a single pointer
field.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 25 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 5 |
2 files changed, 13 insertions, 17 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 56e14b369d42..1000f637edee 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
@@ -1493,8 +1493,8 @@ rpcrdma_buffer_put_mrs(struct rpcrdma_req *req, struct rpcrdma_buffer *buf) | |||
1493 | int i; | 1493 | int i; |
1494 | 1494 | ||
1495 | for (i = 1, seg++; i < RPCRDMA_MAX_SEGS; seg++, i++) | 1495 | for (i = 1, seg++; i < RPCRDMA_MAX_SEGS; seg++, i++) |
1496 | rpcrdma_buffer_put_mr(&seg->mr_chunk.rl_mw, buf); | 1496 | rpcrdma_buffer_put_mr(&seg->rl_mw, buf); |
1497 | rpcrdma_buffer_put_mr(&seg1->mr_chunk.rl_mw, buf); | 1497 | rpcrdma_buffer_put_mr(&seg1->rl_mw, buf); |
1498 | } | 1498 | } |
1499 | 1499 | ||
1500 | static void | 1500 | static void |
@@ -1580,7 +1580,7 @@ rpcrdma_buffer_get_frmrs(struct rpcrdma_req *req, struct rpcrdma_buffer *buf, | |||
1580 | list_add(&r->mw_list, stale); | 1580 | list_add(&r->mw_list, stale); |
1581 | continue; | 1581 | continue; |
1582 | } | 1582 | } |
1583 | req->rl_segments[i].mr_chunk.rl_mw = r; | 1583 | req->rl_segments[i].rl_mw = r; |
1584 | if (unlikely(i-- == 0)) | 1584 | if (unlikely(i-- == 0)) |
1585 | return req; /* Success */ | 1585 | return req; /* Success */ |
1586 | } | 1586 | } |
@@ -1602,7 +1602,7 @@ rpcrdma_buffer_get_fmrs(struct rpcrdma_req *req, struct rpcrdma_buffer *buf) | |||
1602 | r = list_entry(buf->rb_mws.next, | 1602 | r = list_entry(buf->rb_mws.next, |
1603 | struct rpcrdma_mw, mw_list); | 1603 | struct rpcrdma_mw, mw_list); |
1604 | list_del(&r->mw_list); | 1604 | list_del(&r->mw_list); |
1605 | req->rl_segments[i].mr_chunk.rl_mw = r; | 1605 | req->rl_segments[i].rl_mw = r; |
1606 | if (unlikely(i-- == 0)) | 1606 | if (unlikely(i-- == 0)) |
1607 | return req; /* Success */ | 1607 | return req; /* Success */ |
1608 | } | 1608 | } |
@@ -1842,7 +1842,7 @@ rpcrdma_register_frmr_external(struct rpcrdma_mr_seg *seg, | |||
1842 | struct rpcrdma_xprt *r_xprt) | 1842 | struct rpcrdma_xprt *r_xprt) |
1843 | { | 1843 | { |
1844 | struct rpcrdma_mr_seg *seg1 = seg; | 1844 | struct rpcrdma_mr_seg *seg1 = seg; |
1845 | struct rpcrdma_mw *mw = seg1->mr_chunk.rl_mw; | 1845 | struct rpcrdma_mw *mw = seg1->rl_mw; |
1846 | struct rpcrdma_frmr *frmr = &mw->r.frmr; | 1846 | struct rpcrdma_frmr *frmr = &mw->r.frmr; |
1847 | struct ib_mr *mr = frmr->fr_mr; | 1847 | struct ib_mr *mr = frmr->fr_mr; |
1848 | struct ib_send_wr fastreg_wr, *bad_wr; | 1848 | struct ib_send_wr fastreg_wr, *bad_wr; |
@@ -1931,12 +1931,12 @@ rpcrdma_deregister_frmr_external(struct rpcrdma_mr_seg *seg, | |||
1931 | struct ib_send_wr invalidate_wr, *bad_wr; | 1931 | struct ib_send_wr invalidate_wr, *bad_wr; |
1932 | int rc; | 1932 | int rc; |
1933 | 1933 | ||
1934 | seg1->mr_chunk.rl_mw->r.frmr.fr_state = FRMR_IS_INVALID; | 1934 | seg1->rl_mw->r.frmr.fr_state = FRMR_IS_INVALID; |
1935 | 1935 | ||
1936 | memset(&invalidate_wr, 0, sizeof invalidate_wr); | 1936 | memset(&invalidate_wr, 0, sizeof invalidate_wr); |
1937 | invalidate_wr.wr_id = (unsigned long)(void *)seg1->mr_chunk.rl_mw; | 1937 | invalidate_wr.wr_id = (unsigned long)(void *)seg1->rl_mw; |
1938 | invalidate_wr.opcode = IB_WR_LOCAL_INV; | 1938 | invalidate_wr.opcode = IB_WR_LOCAL_INV; |
1939 | invalidate_wr.ex.invalidate_rkey = seg1->mr_chunk.rl_mw->r.frmr.fr_mr->rkey; | 1939 | invalidate_wr.ex.invalidate_rkey = seg1->rl_mw->r.frmr.fr_mr->rkey; |
1940 | DECR_CQCOUNT(&r_xprt->rx_ep); | 1940 | DECR_CQCOUNT(&r_xprt->rx_ep); |
1941 | 1941 | ||
1942 | read_lock(&ia->ri_qplock); | 1942 | read_lock(&ia->ri_qplock); |
@@ -1946,7 +1946,7 @@ rpcrdma_deregister_frmr_external(struct rpcrdma_mr_seg *seg, | |||
1946 | read_unlock(&ia->ri_qplock); | 1946 | read_unlock(&ia->ri_qplock); |
1947 | if (rc) { | 1947 | if (rc) { |
1948 | /* Force rpcrdma_buffer_get() to retry */ | 1948 | /* Force rpcrdma_buffer_get() to retry */ |
1949 | seg1->mr_chunk.rl_mw->r.frmr.fr_state = FRMR_IS_STALE; | 1949 | seg1->rl_mw->r.frmr.fr_state = FRMR_IS_STALE; |
1950 | dprintk("RPC: %s: failed ib_post_send for invalidate," | 1950 | dprintk("RPC: %s: failed ib_post_send for invalidate," |
1951 | " status %i\n", __func__, rc); | 1951 | " status %i\n", __func__, rc); |
1952 | } | 1952 | } |
@@ -1978,8 +1978,7 @@ rpcrdma_register_fmr_external(struct rpcrdma_mr_seg *seg, | |||
1978 | offset_in_page((seg-1)->mr_offset + (seg-1)->mr_len)) | 1978 | offset_in_page((seg-1)->mr_offset + (seg-1)->mr_len)) |
1979 | break; | 1979 | break; |
1980 | } | 1980 | } |
1981 | rc = ib_map_phys_fmr(seg1->mr_chunk.rl_mw->r.fmr, | 1981 | rc = ib_map_phys_fmr(seg1->rl_mw->r.fmr, physaddrs, i, seg1->mr_dma); |
1982 | physaddrs, i, seg1->mr_dma); | ||
1983 | if (rc) { | 1982 | if (rc) { |
1984 | dprintk("RPC: %s: failed ib_map_phys_fmr " | 1983 | dprintk("RPC: %s: failed ib_map_phys_fmr " |
1985 | "%u@0x%llx+%i (%d)... status %i\n", __func__, | 1984 | "%u@0x%llx+%i (%d)... status %i\n", __func__, |
@@ -1988,7 +1987,7 @@ rpcrdma_register_fmr_external(struct rpcrdma_mr_seg *seg, | |||
1988 | while (i--) | 1987 | while (i--) |
1989 | rpcrdma_unmap_one(ia, --seg); | 1988 | rpcrdma_unmap_one(ia, --seg); |
1990 | } else { | 1989 | } else { |
1991 | seg1->mr_rkey = seg1->mr_chunk.rl_mw->r.fmr->rkey; | 1990 | seg1->mr_rkey = seg1->rl_mw->r.fmr->rkey; |
1992 | seg1->mr_base = seg1->mr_dma + pageoff; | 1991 | seg1->mr_base = seg1->mr_dma + pageoff; |
1993 | seg1->mr_nsegs = i; | 1992 | seg1->mr_nsegs = i; |
1994 | seg1->mr_len = len; | 1993 | seg1->mr_len = len; |
@@ -2005,7 +2004,7 @@ rpcrdma_deregister_fmr_external(struct rpcrdma_mr_seg *seg, | |||
2005 | LIST_HEAD(l); | 2004 | LIST_HEAD(l); |
2006 | int rc; | 2005 | int rc; |
2007 | 2006 | ||
2008 | list_add(&seg1->mr_chunk.rl_mw->r.fmr->list, &l); | 2007 | list_add(&seg1->rl_mw->r.fmr->list, &l); |
2009 | rc = ib_unmap_fmr(&l); | 2008 | rc = ib_unmap_fmr(&l); |
2010 | read_lock(&ia->ri_qplock); | 2009 | read_lock(&ia->ri_qplock); |
2011 | while (seg1->mr_nsegs--) | 2010 | while (seg1->mr_nsegs--) |
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 5160a84fdb72..532d58667b9d 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
@@ -210,10 +210,7 @@ struct rpcrdma_mw { | |||
210 | */ | 210 | */ |
211 | 211 | ||
212 | struct rpcrdma_mr_seg { /* chunk descriptors */ | 212 | struct rpcrdma_mr_seg { /* chunk descriptors */ |
213 | union { /* chunk memory handles */ | 213 | struct rpcrdma_mw *rl_mw; /* registered MR */ |
214 | struct ib_mr *rl_mr; /* if registered directly */ | ||
215 | struct rpcrdma_mw *rl_mw; /* if registered from region */ | ||
216 | } mr_chunk; | ||
217 | u64 mr_base; /* registration result */ | 214 | u64 mr_base; /* registration result */ |
218 | u32 mr_rkey; /* registration result */ | 215 | u32 mr_rkey; /* registration result */ |
219 | u32 mr_len; /* length of chunk or segment */ | 216 | u32 mr_len; /* length of chunk or segment */ |