diff options
author | Chuck Lever <cel@netapp.com> | 2005-08-25 19:25:55 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-09-23 12:38:53 -0400 |
commit | 03bf4b707eee06706c9db343dd5c905b7ee47ed2 (patch) | |
tree | 54f89b578758e2bf2650b647ae1c7100c882a757 /net/sunrpc/xprt.c | |
parent | 3167e12c0c424f3c323944701615343022d86418 (diff) |
[PATCH] RPC: parametrize various transport connect timeouts
Each transport implementation can now set unique bind, connect,
reestablishment, and idle timeout values. These are variables,
allowing the values to be modified dynamically. This permits
exponential backoff of any of these values, for instance.
As an example, we implement exponential backoff for the connection
reestablishment timeout.
Test-plan:
Destructive testing (unplugging the network temporarily). Connectathon
with UDP and TCP.
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 0458319a1bdd..215be0d0ef6b 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -551,7 +551,7 @@ void xprt_connect(struct rpc_task *task) | |||
551 | if (task->tk_rqstp) | 551 | if (task->tk_rqstp) |
552 | task->tk_rqstp->rq_bytes_sent = 0; | 552 | task->tk_rqstp->rq_bytes_sent = 0; |
553 | 553 | ||
554 | task->tk_timeout = RPC_CONNECT_TIMEOUT; | 554 | task->tk_timeout = xprt->connect_timeout; |
555 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status, NULL); | 555 | rpc_sleep_on(&xprt->pending, task, xprt_connect_status, NULL); |
556 | xprt->ops->connect(task); | 556 | xprt->ops->connect(task); |
557 | } | 557 | } |
@@ -763,7 +763,6 @@ void xprt_transmit(struct rpc_task *task) | |||
763 | 763 | ||
764 | switch (status) { | 764 | switch (status) { |
765 | case -ECONNREFUSED: | 765 | case -ECONNREFUSED: |
766 | task->tk_timeout = RPC_REESTABLISH_TIMEOUT; | ||
767 | rpc_sleep_on(&xprt->sending, task, NULL, NULL); | 766 | rpc_sleep_on(&xprt->sending, task, NULL, NULL); |
768 | case -EAGAIN: | 767 | case -EAGAIN: |
769 | case -ENOTCONN: | 768 | case -ENOTCONN: |
@@ -857,7 +856,7 @@ void xprt_release(struct rpc_task *task) | |||
857 | xprt->last_used = jiffies; | 856 | xprt->last_used = jiffies; |
858 | if (list_empty(&xprt->recv) && !xprt->shutdown) | 857 | if (list_empty(&xprt->recv) && !xprt->shutdown) |
859 | mod_timer(&xprt->timer, | 858 | mod_timer(&xprt->timer, |
860 | xprt->last_used + RPC_IDLE_DISCONNECT_TIMEOUT); | 859 | xprt->last_used + xprt->idle_timeout); |
861 | spin_unlock_bh(&xprt->transport_lock); | 860 | spin_unlock_bh(&xprt->transport_lock); |
862 | task->tk_rqstp = NULL; | 861 | task->tk_rqstp = NULL; |
863 | memset(req, 0, sizeof(*req)); /* mark unused */ | 862 | memset(req, 0, sizeof(*req)); /* mark unused */ |