Commit 575448bd authored by Tom Talpey's avatar Tom Talpey Committed by Trond Myklebust

RPC/RDMA: suppress retransmit on RPC/RDMA clients.

An RPC/RDMA client cannot retransmit on an unbroken connection,
doing so violates its flow control with the server.
Signed-off-by: default avatarTom Talpey <talpey@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent b334eaab
...@@ -681,6 +681,8 @@ rpcrdma_conn_func(struct rpcrdma_ep *ep) ...@@ -681,6 +681,8 @@ rpcrdma_conn_func(struct rpcrdma_ep *ep)
struct rpc_xprt *xprt = ep->rep_xprt; struct rpc_xprt *xprt = ep->rep_xprt;
spin_lock_bh(&xprt->transport_lock); spin_lock_bh(&xprt->transport_lock);
if (++xprt->connect_cookie == 0) /* maintain a reserved value */
++xprt->connect_cookie;
if (ep->rep_connected > 0) { if (ep->rep_connected > 0) {
if (!xprt_test_and_set_connected(xprt)) if (!xprt_test_and_set_connected(xprt))
xprt_wake_pending_tasks(xprt, 0); xprt_wake_pending_tasks(xprt, 0);
......
...@@ -587,6 +587,7 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size) ...@@ -587,6 +587,7 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
} }
dprintk("RPC: %s: size %zd, request 0x%p\n", __func__, size, req); dprintk("RPC: %s: size %zd, request 0x%p\n", __func__, size, req);
out: out:
req->rl_connect_cookie = 0; /* our reserved value */
return req->rl_xdr_buf; return req->rl_xdr_buf;
outfail: outfail:
...@@ -690,13 +691,20 @@ xprt_rdma_send_request(struct rpc_task *task) ...@@ -690,13 +691,20 @@ xprt_rdma_send_request(struct rpc_task *task)
req->rl_reply->rr_xprt = xprt; req->rl_reply->rr_xprt = xprt;
} }
if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) { /* Must suppress retransmit to maintain credits */
xprt_disconnect_done(xprt); if (req->rl_connect_cookie == xprt->connect_cookie)
return -ENOTCONN; /* implies disconnect */ goto drop_connection;
} req->rl_connect_cookie = xprt->connect_cookie;
if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
goto drop_connection;
rqst->rq_bytes_sent = 0; rqst->rq_bytes_sent = 0;
return 0; return 0;
drop_connection:
xprt_disconnect_done(xprt);
return -ENOTCONN; /* implies disconnect */
} }
static void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq) static void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
......
...@@ -181,6 +181,7 @@ struct rpcrdma_req { ...@@ -181,6 +181,7 @@ struct rpcrdma_req {
size_t rl_size; /* actual length of buffer */ size_t rl_size; /* actual length of buffer */
unsigned int rl_niovs; /* 0, 2 or 4 */ unsigned int rl_niovs; /* 0, 2 or 4 */
unsigned int rl_nchunks; /* non-zero if chunks */ unsigned int rl_nchunks; /* non-zero if chunks */
unsigned int rl_connect_cookie; /* retry detection */
struct rpcrdma_buffer *rl_buffer; /* home base for this structure */ struct rpcrdma_buffer *rl_buffer; /* home base for this structure */
struct rpcrdma_rep *rl_reply;/* holder for reply buffer */ struct rpcrdma_rep *rl_reply;/* holder for reply buffer */
struct rpcrdma_mr_seg rl_segments[RPCRDMA_MAX_SEGS];/* chunk segments */ struct rpcrdma_mr_seg rl_segments[RPCRDMA_MAX_SEGS];/* chunk segments */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment