提交 a7bc211a 编写于 作者: C Chuck Lever 提交者: Anna Schumaker

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: NChuck Lever <chuck.lever@oracle.com>
Tested-by: NSteve Wise <swise@opengridcomputing.com>
Tested-by: NShirley Ma <shirley.ma@oracle.com>
Tested-by: NDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
上级 6ab59945
...@@ -310,6 +310,13 @@ rpcrdma_recvcq_upcall(struct ib_cq *cq, void *cq_context) ...@@ -310,6 +310,13 @@ rpcrdma_recvcq_upcall(struct ib_cq *cq, void *cq_context)
rpcrdma_recvcq_poll(cq, ep); rpcrdma_recvcq_poll(cq, ep);
} }
static void
rpcrdma_flush_cqs(struct rpcrdma_ep *ep)
{
rpcrdma_recvcq_upcall(ep->rep_attr.recv_cq, ep);
rpcrdma_sendcq_upcall(ep->rep_attr.send_cq, ep);
}
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
static const char * const conn[] = { static const char * const conn[] = {
"address resolved", "address resolved",
...@@ -872,9 +879,7 @@ rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) ...@@ -872,9 +879,7 @@ rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
if (rc && rc != -ENOTCONN) if (rc && rc != -ENOTCONN)
dprintk("RPC: %s: rpcrdma_ep_disconnect" dprintk("RPC: %s: rpcrdma_ep_disconnect"
" status %i\n", __func__, rc); " status %i\n", __func__, rc);
rpcrdma_flush_cqs(ep);
rpcrdma_clean_cq(ep->rep_attr.recv_cq);
rpcrdma_clean_cq(ep->rep_attr.send_cq);
xprt = container_of(ia, struct rpcrdma_xprt, rx_ia); xprt = container_of(ia, struct rpcrdma_xprt, rx_ia);
id = rpcrdma_create_id(xprt, ia, id = rpcrdma_create_id(xprt, ia,
...@@ -985,8 +990,7 @@ rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) ...@@ -985,8 +990,7 @@ rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
{ {
int rc; int rc;
rpcrdma_clean_cq(ep->rep_attr.recv_cq); rpcrdma_flush_cqs(ep);
rpcrdma_clean_cq(ep->rep_attr.send_cq);
rc = rdma_disconnect(ia->ri_id); rc = rdma_disconnect(ia->ri_id);
if (!rc) { if (!rc) {
/* returns without wait if not connected */ /* returns without wait if not connected */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册