Commit 5c81833c authored by Andy Gospodarek's avatar Andy Gospodarek Committed by David S. Miller

[IPVS]: use proper timeout instead of fixed value

Instead of using the default timeout of 3 minutes, this uses the timeout
specific to the protocol used for the connection. The 3 minute timeout
seems somewhat arbitrary (though I know it is used other places in the
ipvs code) and when failing over it would be much nicer to use one of
the configured timeout values.
Signed-off-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad02ac14
...@@ -72,7 +72,6 @@ struct ip_vs_sync_thread_data { ...@@ -72,7 +72,6 @@ struct ip_vs_sync_thread_data {
int state; int state;
}; };
#define IP_VS_SYNC_CONN_TIMEOUT (3*60*HZ)
#define SIMPLE_CONN_SIZE (sizeof(struct ip_vs_sync_conn)) #define SIMPLE_CONN_SIZE (sizeof(struct ip_vs_sync_conn))
#define FULL_CONN_SIZE \ #define FULL_CONN_SIZE \
(sizeof(struct ip_vs_sync_conn) + sizeof(struct ip_vs_sync_conn_options)) (sizeof(struct ip_vs_sync_conn) + sizeof(struct ip_vs_sync_conn_options))
...@@ -284,6 +283,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) ...@@ -284,6 +283,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
struct ip_vs_sync_conn *s; struct ip_vs_sync_conn *s;
struct ip_vs_sync_conn_options *opt; struct ip_vs_sync_conn_options *opt;
struct ip_vs_conn *cp; struct ip_vs_conn *cp;
struct ip_vs_protocol *pp;
char *p; char *p;
int i; int i;
...@@ -342,7 +342,8 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) ...@@ -342,7 +342,8 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
p += SIMPLE_CONN_SIZE; p += SIMPLE_CONN_SIZE;
atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]); atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]);
cp->timeout = IP_VS_SYNC_CONN_TIMEOUT; pp = ip_vs_proto_get(s->protocol);
cp->timeout = pp->timeout_table[cp->state];
ip_vs_conn_put(cp); ip_vs_conn_put(cp);
if (p > buffer+buflen) { if (p > buffer+buflen) {
......
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