mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 23:39:18 +00:00
xprtrdma: Clear xprt->reestablish_timeout on close
Ensure that the re-establishment delay does not grow exponentially on each good reconnect. This probably should have been part of commit 675dd90ad093 ("xprtrdma: Modernize ops->connect"). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
ee2f412ece
commit
f9e1afe0fa
@ -1261,8 +1261,6 @@ void rpcrdma_complete_rqst(struct rpcrdma_rep *rep)
|
|||||||
struct rpc_rqst *rqst = rep->rr_rqst;
|
struct rpc_rqst *rqst = rep->rr_rqst;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
xprt->reestablish_timeout = 0;
|
|
||||||
|
|
||||||
switch (rep->rr_proc) {
|
switch (rep->rr_proc) {
|
||||||
case rdma_msg:
|
case rdma_msg:
|
||||||
status = rpcrdma_decode_msg(r_xprt, rep, rqst);
|
status = rpcrdma_decode_msg(r_xprt, rep, rqst);
|
||||||
@ -1321,6 +1319,12 @@ void rpcrdma_reply_handler(struct rpcrdma_rep *rep)
|
|||||||
u32 credits;
|
u32 credits;
|
||||||
__be32 *p;
|
__be32 *p;
|
||||||
|
|
||||||
|
/* Any data means we had a useful conversation, so
|
||||||
|
* then we don't need to delay the next reconnect.
|
||||||
|
*/
|
||||||
|
if (xprt->reestablish_timeout)
|
||||||
|
xprt->reestablish_timeout = 0;
|
||||||
|
|
||||||
/* Fixed transport header fields */
|
/* Fixed transport header fields */
|
||||||
xdr_init_decode(&rep->rr_stream, &rep->rr_hdrbuf,
|
xdr_init_decode(&rep->rr_stream, &rep->rr_hdrbuf,
|
||||||
rep->rr_hdrbuf.head[0].iov_base, NULL);
|
rep->rr_hdrbuf.head[0].iov_base, NULL);
|
||||||
|
@ -423,8 +423,6 @@ void xprt_rdma_close(struct rpc_xprt *xprt)
|
|||||||
|
|
||||||
if (ep->rep_connected == -ENODEV)
|
if (ep->rep_connected == -ENODEV)
|
||||||
return;
|
return;
|
||||||
if (ep->rep_connected > 0)
|
|
||||||
xprt->reestablish_timeout = 0;
|
|
||||||
rpcrdma_ep_disconnect(ep, ia);
|
rpcrdma_ep_disconnect(ep, ia);
|
||||||
|
|
||||||
/* Prepare @xprt for the next connection by reinitializing
|
/* Prepare @xprt for the next connection by reinitializing
|
||||||
@ -434,6 +432,7 @@ void xprt_rdma_close(struct rpc_xprt *xprt)
|
|||||||
xprt->cwnd = RPC_CWNDSHIFT;
|
xprt->cwnd = RPC_CWNDSHIFT;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
xprt->reestablish_timeout = 0;
|
||||||
++xprt->connect_cookie;
|
++xprt->connect_cookie;
|
||||||
xprt_disconnect_done(xprt);
|
xprt_disconnect_done(xprt);
|
||||||
}
|
}
|
||||||
|
@ -731,6 +731,8 @@ retry:
|
|||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (xprt->reestablish_timeout < RPCRDMA_INIT_REEST_TO)
|
||||||
|
xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO;
|
||||||
wait_event_interruptible(ep->rep_connect_wait, ep->rep_connected != 0);
|
wait_event_interruptible(ep->rep_connect_wait, ep->rep_connected != 0);
|
||||||
if (ep->rep_connected <= 0) {
|
if (ep->rep_connected <= 0) {
|
||||||
if (ep->rep_connected == -EAGAIN)
|
if (ep->rep_connected == -EAGAIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user