diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2017-10-27 10:49:51 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-11-07 16:44:02 -0500 |
commit | 77a08867a66796f8316449e030e0bfc84f2a3f66 (patch) | |
tree | 6b6155101bd0462b3fae131576a4080a79b7df8b /net/sunrpc | |
parent | 7e981a8afa6d8d1d93e2b3d162aa81cc7b537208 (diff) |
svcrdma: Enqueue after setting XPT_CLOSE in completion handlers
I noticed the server was sometimes not closing the connection after
a flushed Send. For example, if the client responds with an RNR NAK
to a Reply from the server, that client might be deadlocked, and
thus wouldn't send any more traffic. Thus the server wouldn't have
any opportunity to notice the XPT_CLOSE bit has been set.
Enqueue the transport so that svcxprt notices the bit even if there
is no more transport activity after a flushed completion, QP access
error, or device removal event.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-By: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 5caf8e722a11..46ec069150d5 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -290,6 +290,7 @@ static void qp_event_handler(struct ib_event *event, void *context) | |||
290 | ib_event_msg(event->event), event->event, | 290 | ib_event_msg(event->event), event->event, |
291 | event->element.qp); | 291 | event->element.qp); |
292 | set_bit(XPT_CLOSE, &xprt->xpt_flags); | 292 | set_bit(XPT_CLOSE, &xprt->xpt_flags); |
293 | svc_xprt_enqueue(xprt); | ||
293 | break; | 294 | break; |
294 | } | 295 | } |
295 | } | 296 | } |
@@ -322,8 +323,7 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) | |||
322 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); | 323 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); |
323 | if (test_bit(RDMAXPRT_CONN_PENDING, &xprt->sc_flags)) | 324 | if (test_bit(RDMAXPRT_CONN_PENDING, &xprt->sc_flags)) |
324 | goto out; | 325 | goto out; |
325 | svc_xprt_enqueue(&xprt->sc_xprt); | 326 | goto out_enqueue; |
326 | goto out; | ||
327 | 327 | ||
328 | flushed: | 328 | flushed: |
329 | if (wc->status != IB_WC_WR_FLUSH_ERR) | 329 | if (wc->status != IB_WC_WR_FLUSH_ERR) |
@@ -333,6 +333,8 @@ flushed: | |||
333 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); | 333 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); |
334 | svc_rdma_put_context(ctxt, 1); | 334 | svc_rdma_put_context(ctxt, 1); |
335 | 335 | ||
336 | out_enqueue: | ||
337 | svc_xprt_enqueue(&xprt->sc_xprt); | ||
336 | out: | 338 | out: |
337 | svc_xprt_put(&xprt->sc_xprt); | 339 | svc_xprt_put(&xprt->sc_xprt); |
338 | } | 340 | } |
@@ -358,6 +360,7 @@ void svc_rdma_wc_send(struct ib_cq *cq, struct ib_wc *wc) | |||
358 | 360 | ||
359 | if (unlikely(wc->status != IB_WC_SUCCESS)) { | 361 | if (unlikely(wc->status != IB_WC_SUCCESS)) { |
360 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); | 362 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); |
363 | svc_xprt_enqueue(&xprt->sc_xprt); | ||
361 | if (wc->status != IB_WC_WR_FLUSH_ERR) | 364 | if (wc->status != IB_WC_WR_FLUSH_ERR) |
362 | pr_err("svcrdma: Send: %s (%u/0x%x)\n", | 365 | pr_err("svcrdma: Send: %s (%u/0x%x)\n", |
363 | ib_wc_status_msg(wc->status), | 366 | ib_wc_status_msg(wc->status), |
@@ -569,8 +572,10 @@ static int rdma_listen_handler(struct rdma_cm_id *cma_id, | |||
569 | case RDMA_CM_EVENT_DEVICE_REMOVAL: | 572 | case RDMA_CM_EVENT_DEVICE_REMOVAL: |
570 | dprintk("svcrdma: Device removal xprt=%p, cm_id=%p\n", | 573 | dprintk("svcrdma: Device removal xprt=%p, cm_id=%p\n", |
571 | xprt, cma_id); | 574 | xprt, cma_id); |
572 | if (xprt) | 575 | if (xprt) { |
573 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); | 576 | set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags); |
577 | svc_xprt_enqueue(&xprt->sc_xprt); | ||
578 | } | ||
574 | break; | 579 | break; |
575 | 580 | ||
576 | default: | 581 | default: |