diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2014-05-28 10:34:32 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2014-06-04 08:56:50 -0400 |
commit | bfaee096deaa680195df5491eb650f81051c145d (patch) | |
tree | 55b54123473f134f494612a35acdef8305a416f4 /net/sunrpc | |
parent | 196c69989d84ab902bbe545f7bd8ce78ee74dac4 (diff) |
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: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index d18b2a364762..6b84d7d59e18 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -149,6 +149,11 @@ static struct ctl_table sunrpc_table[] = { | |||
149 | 149 | ||
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #define RPCRDMA_BIND_TO (60U * HZ) | ||
153 | #define RPCRDMA_INIT_REEST_TO (5U * HZ) | ||
154 | #define RPCRDMA_MAX_REEST_TO (30U * HZ) | ||
155 | #define RPCRDMA_IDLE_DISC_TO (5U * 60 * HZ) | ||
156 | |||
152 | static struct rpc_xprt_ops xprt_rdma_procs; /* forward reference */ | 157 | static struct rpc_xprt_ops xprt_rdma_procs; /* forward reference */ |
153 | 158 | ||
154 | static void | 159 | static void |
@@ -285,9 +290,9 @@ xprt_setup_rdma(struct xprt_create *args) | |||
285 | 290 | ||
286 | /* 60 second timeout, no retries */ | 291 | /* 60 second timeout, no retries */ |
287 | xprt->timeout = &xprt_rdma_default_timeout; | 292 | xprt->timeout = &xprt_rdma_default_timeout; |
288 | xprt->bind_timeout = (60U * HZ); | 293 | xprt->bind_timeout = RPCRDMA_BIND_TO; |
289 | xprt->reestablish_timeout = (5U * HZ); | 294 | xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO; |
290 | xprt->idle_timeout = (5U * 60 * HZ); | 295 | xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO; |
291 | 296 | ||
292 | xprt->resvport = 0; /* privileged port not needed */ | 297 | xprt->resvport = 0; /* privileged port not needed */ |
293 | xprt->tsh_size = 0; /* RPC-RDMA handles framing */ | 298 | xprt->tsh_size = 0; /* RPC-RDMA handles framing */ |
@@ -432,10 +437,10 @@ xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task) | |||
432 | schedule_delayed_work(&r_xprt->rdma_connect, | 437 | schedule_delayed_work(&r_xprt->rdma_connect, |
433 | xprt->reestablish_timeout); | 438 | xprt->reestablish_timeout); |
434 | xprt->reestablish_timeout <<= 1; | 439 | xprt->reestablish_timeout <<= 1; |
435 | if (xprt->reestablish_timeout > (30 * HZ)) | 440 | if (xprt->reestablish_timeout > RPCRDMA_MAX_REEST_TO) |
436 | xprt->reestablish_timeout = (30 * HZ); | 441 | xprt->reestablish_timeout = RPCRDMA_MAX_REEST_TO; |
437 | else if (xprt->reestablish_timeout < (5 * HZ)) | 442 | else if (xprt->reestablish_timeout < RPCRDMA_INIT_REEST_TO) |
438 | xprt->reestablish_timeout = (5 * HZ); | 443 | xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO; |
439 | } else { | 444 | } else { |
440 | schedule_delayed_work(&r_xprt->rdma_connect, 0); | 445 | schedule_delayed_work(&r_xprt->rdma_connect, 0); |
441 | if (!RPC_IS_ASYNC(task)) | 446 | if (!RPC_IS_ASYNC(task)) |