aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2014-07-29 17:24:28 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2014-07-31 16:22:54 -0400
commit3111d72c7ced444b1034f6e365e0e02444c68aa8 (patch)
treed96aba9d9a27228ade6dc765f2269141b2f836f0 /net
parentc93e986a295d537589efd0504f36ca952bd1a5be (diff)
xprtrdma: Chain together all MWs in same buffer pool
During connection loss recovery, need to visit every MW in a buffer pool. Any MW that is in use by an RPC will not be on the rb_mws list. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Steve Wise <swise@opengridcomputing.com> Tested-by: Shirley Ma <shirley.ma@oracle.com> Tested-by: Devesh Sharma <devesh.sharma@emulex.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtrdma/verbs.c4
-rw-r--r--net/sunrpc/xprtrdma/xprt_rdma.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index b670f4d92840..0ad7d10f13a7 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1074,6 +1074,7 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
1074 p += cdata->padding; 1074 p += cdata->padding;
1075 1075
1076 INIT_LIST_HEAD(&buf->rb_mws); 1076 INIT_LIST_HEAD(&buf->rb_mws);
1077 INIT_LIST_HEAD(&buf->rb_all);
1077 r = (struct rpcrdma_mw *)p; 1078 r = (struct rpcrdma_mw *)p;
1078 switch (ia->ri_memreg_strategy) { 1079 switch (ia->ri_memreg_strategy) {
1079 case RPCRDMA_FRMR: 1080 case RPCRDMA_FRMR:
@@ -1098,6 +1099,7 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
1098 ib_dereg_mr(r->r.frmr.fr_mr); 1099 ib_dereg_mr(r->r.frmr.fr_mr);
1099 goto out; 1100 goto out;
1100 } 1101 }
1102 list_add(&r->mw_all, &buf->rb_all);
1101 list_add(&r->mw_list, &buf->rb_mws); 1103 list_add(&r->mw_list, &buf->rb_mws);
1102 ++r; 1104 ++r;
1103 } 1105 }
@@ -1116,6 +1118,7 @@ rpcrdma_buffer_create(struct rpcrdma_buffer *buf, struct rpcrdma_ep *ep,
1116 " failed %i\n", __func__, rc); 1118 " failed %i\n", __func__, rc);
1117 goto out; 1119 goto out;
1118 } 1120 }
1121 list_add(&r->mw_all, &buf->rb_all);
1119 list_add(&r->mw_list, &buf->rb_mws); 1122 list_add(&r->mw_list, &buf->rb_mws);
1120 ++r; 1123 ++r;
1121 } 1124 }
@@ -1225,6 +1228,7 @@ rpcrdma_buffer_destroy(struct rpcrdma_buffer *buf)
1225 while (!list_empty(&buf->rb_mws)) { 1228 while (!list_empty(&buf->rb_mws)) {
1226 r = list_entry(buf->rb_mws.next, 1229 r = list_entry(buf->rb_mws.next,
1227 struct rpcrdma_mw, mw_list); 1230 struct rpcrdma_mw, mw_list);
1231 list_del(&r->mw_all);
1228 list_del(&r->mw_list); 1232 list_del(&r->mw_list);
1229 switch (ia->ri_memreg_strategy) { 1233 switch (ia->ri_memreg_strategy) {
1230 case RPCRDMA_FRMR: 1234 case RPCRDMA_FRMR:
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index 84c3455a9521..c1d865287b0e 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -151,7 +151,7 @@ struct rpcrdma_rep {
151 * An external memory region is any buffer or page that is registered 151 * An external memory region is any buffer or page that is registered
152 * on the fly (ie, not pre-registered). 152 * on the fly (ie, not pre-registered).
153 * 153 *
154 * Each rpcrdma_buffer has a list of these anchored in rb_mws. During 154 * Each rpcrdma_buffer has a list of free MWs anchored in rb_mws. During
155 * call_allocate, rpcrdma_buffer_get() assigns one to each segment in 155 * call_allocate, rpcrdma_buffer_get() assigns one to each segment in
156 * an rpcrdma_req. Then rpcrdma_register_external() grabs these to keep 156 * an rpcrdma_req. Then rpcrdma_register_external() grabs these to keep
157 * track of registration metadata while each RPC is pending. 157 * track of registration metadata while each RPC is pending.
@@ -175,6 +175,7 @@ struct rpcrdma_mw {
175 struct rpcrdma_frmr frmr; 175 struct rpcrdma_frmr frmr;
176 } r; 176 } r;
177 struct list_head mw_list; 177 struct list_head mw_list;
178 struct list_head mw_all;
178}; 179};
179 180
180/* 181/*
@@ -246,6 +247,7 @@ struct rpcrdma_buffer {
246 atomic_t rb_credits; /* most recent server credits */ 247 atomic_t rb_credits; /* most recent server credits */
247 int rb_max_requests;/* client max requests */ 248 int rb_max_requests;/* client max requests */
248 struct list_head rb_mws; /* optional memory windows/fmrs/frmrs */ 249 struct list_head rb_mws; /* optional memory windows/fmrs/frmrs */
250 struct list_head rb_all;
249 int rb_send_index; 251 int rb_send_index;
250 struct rpcrdma_req **rb_send_bufs; 252 struct rpcrdma_req **rb_send_bufs;
251 int rb_recv_index; 253 int rb_recv_index;