Skip to content

Commit a7bc211

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: On disconnect, don't ignore pending CQEs
xprtrdma is currently throwing away queued completions during a reconnect. RPC replies posted just before connection loss, or successful completions that change the state of an FRMR, can be missed. Signed-off-by: Chuck Lever <[email protected]> Tested-by: Steve Wise <[email protected]> Tested-by: Shirley Ma <[email protected]> Tested-by: Devesh Sharma <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 6ab5994 commit a7bc211

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ rpcrdma_recvcq_upcall(struct ib_cq *cq, void *cq_context)
310310
rpcrdma_recvcq_poll(cq, ep);
311311
}
312312

313+
static void
314+
rpcrdma_flush_cqs(struct rpcrdma_ep *ep)
315+
{
316+
rpcrdma_recvcq_upcall(ep->rep_attr.recv_cq, ep);
317+
rpcrdma_sendcq_upcall(ep->rep_attr.send_cq, ep);
318+
}
319+
313320
#ifdef RPC_DEBUG
314321
static const char * const conn[] = {
315322
"address resolved",
@@ -872,9 +879,7 @@ rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
872879
if (rc && rc != -ENOTCONN)
873880
dprintk("RPC: %s: rpcrdma_ep_disconnect"
874881
" status %i\n", __func__, rc);
875-
876-
rpcrdma_clean_cq(ep->rep_attr.recv_cq);
877-
rpcrdma_clean_cq(ep->rep_attr.send_cq);
882+
rpcrdma_flush_cqs(ep);
878883

879884
xprt = container_of(ia, struct rpcrdma_xprt, rx_ia);
880885
id = rpcrdma_create_id(xprt, ia,
@@ -985,8 +990,7 @@ rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
985990
{
986991
int rc;
987992

988-
rpcrdma_clean_cq(ep->rep_attr.recv_cq);
989-
rpcrdma_clean_cq(ep->rep_attr.send_cq);
993+
rpcrdma_flush_cqs(ep);
990994
rc = rdma_disconnect(ia->ri_id);
991995
if (!rc) {
992996
/* returns without wait if not connected */

0 commit comments

Comments
 (0)