Skip to content

Commit 895cedc

Browse files
chuckleverTrond Myklebust
authored andcommitted
xprtrdma: Remap Receive buffers after a reconnect
On server-initiated disconnect, rpcrdma_xprt_disconnect() was DMA- unmapping the Receive buffers, but rpcrdma_post_recvs() neglected to remap them after a new connection had been established. The result was immediate failure of the new connection with the Receives flushing with LOCAL_PROT_ERR. Fixes: 671c450 ("xprtrdma: Fix oops in Receive handler after device removal") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent f4e89f1 commit 895cedc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -935,9 +935,6 @@ struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt,
935935
if (!rep->rr_rdmabuf)
936936
goto out_free;
937937

938-
if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf))
939-
goto out_free_regbuf;
940-
941938
rep->rr_cid.ci_completion_id =
942939
atomic_inc_return(&r_xprt->rx_ep->re_completion_ids);
943940

@@ -956,8 +953,6 @@ struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt,
956953
spin_unlock(&buf->rb_lock);
957954
return rep;
958955

959-
out_free_regbuf:
960-
rpcrdma_regbuf_free(rep->rr_rdmabuf);
961956
out_free:
962957
kfree(rep);
963958
out:
@@ -1363,6 +1358,10 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp)
13631358
rep = rpcrdma_rep_create(r_xprt, temp);
13641359
if (!rep)
13651360
break;
1361+
if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) {
1362+
rpcrdma_rep_put(buf, rep);
1363+
break;
1364+
}
13661365

13671366
rep->rr_cid.ci_queue_id = ep->re_attr.recv_cq->res.id;
13681367
trace_xprtrdma_post_recv(rep);

0 commit comments

Comments
 (0)