Commit bfaee096 authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

xprtrdma: Use macros for reconnection timeout constants

Clean up: Ensure the same max and min constant values are used
everywhere when setting reconnect timeouts.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 196c6998
...@@ -149,6 +149,11 @@ static struct ctl_table sunrpc_table[] = { ...@@ -149,6 +149,11 @@ static struct ctl_table sunrpc_table[] = {
#endif #endif
#define RPCRDMA_BIND_TO (60U * HZ)
#define RPCRDMA_INIT_REEST_TO (5U * HZ)
#define RPCRDMA_MAX_REEST_TO (30U * HZ)
#define RPCRDMA_IDLE_DISC_TO (5U * 60 * HZ)
static struct rpc_xprt_ops xprt_rdma_procs; /* forward reference */ static struct rpc_xprt_ops xprt_rdma_procs; /* forward reference */
static void static void
...@@ -285,9 +290,9 @@ xprt_setup_rdma(struct xprt_create *args) ...@@ -285,9 +290,9 @@ xprt_setup_rdma(struct xprt_create *args)
/* 60 second timeout, no retries */ /* 60 second timeout, no retries */
xprt->timeout = &xprt_rdma_default_timeout; xprt->timeout = &xprt_rdma_default_timeout;
xprt->bind_timeout = (60U * HZ); xprt->bind_timeout = RPCRDMA_BIND_TO;
xprt->reestablish_timeout = (5U * HZ); xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO;
xprt->idle_timeout = (5U * 60 * HZ); xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO;
xprt->resvport = 0; /* privileged port not needed */ xprt->resvport = 0; /* privileged port not needed */
xprt->tsh_size = 0; /* RPC-RDMA handles framing */ xprt->tsh_size = 0; /* RPC-RDMA handles framing */
...@@ -432,10 +437,10 @@ xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -432,10 +437,10 @@ xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task)
schedule_delayed_work(&r_xprt->rdma_connect, schedule_delayed_work(&r_xprt->rdma_connect,
xprt->reestablish_timeout); xprt->reestablish_timeout);
xprt->reestablish_timeout <<= 1; xprt->reestablish_timeout <<= 1;
if (xprt->reestablish_timeout > (30 * HZ)) if (xprt->reestablish_timeout > RPCRDMA_MAX_REEST_TO)
xprt->reestablish_timeout = (30 * HZ); xprt->reestablish_timeout = RPCRDMA_MAX_REEST_TO;
else if (xprt->reestablish_timeout < (5 * HZ)) else if (xprt->reestablish_timeout < RPCRDMA_INIT_REEST_TO)
xprt->reestablish_timeout = (5 * HZ); xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO;
} else { } else {
schedule_delayed_work(&r_xprt->rdma_connect, 0); schedule_delayed_work(&r_xprt->rdma_connect, 0);
if (!RPC_IS_ASYNC(task)) if (!RPC_IS_ASYNC(task))
......
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