diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 56b5f49e3f97..7e4be4f361f3 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2419,7 +2419,7 @@ static void __net_exit tcp_sk_exit(struct net *net) | |||
2419 | 2419 | ||
2420 | static int __net_init tcp_sk_init(struct net *net) | 2420 | static int __net_init tcp_sk_init(struct net *net) |
2421 | { | 2421 | { |
2422 | int res, cpu; | 2422 | int res, cpu, cnt; |
2423 | 2423 | ||
2424 | net->ipv4.tcp_sk = alloc_percpu(struct sock *); | 2424 | net->ipv4.tcp_sk = alloc_percpu(struct sock *); |
2425 | if (!net->ipv4.tcp_sk) | 2425 | if (!net->ipv4.tcp_sk) |
@@ -2458,10 +2458,13 @@ static int __net_init tcp_sk_init(struct net *net) | |||
2458 | net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; | 2458 | net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; |
2459 | net->ipv4.sysctl_tcp_tw_reuse = 0; | 2459 | net->ipv4.sysctl_tcp_tw_reuse = 0; |
2460 | 2460 | ||
2461 | cnt = tcp_hashinfo.ehash_mask + 1; | ||
2461 | net->ipv4.tcp_death_row.sysctl_tw_recycle = 0; | 2462 | net->ipv4.tcp_death_row.sysctl_tw_recycle = 0; |
2462 | net->ipv4.tcp_death_row.sysctl_max_tw_buckets = (tcp_hashinfo.ehash_mask + 1) / 2; | 2463 | net->ipv4.tcp_death_row.sysctl_max_tw_buckets = (cnt + 1) / 2; |
2463 | net->ipv4.tcp_death_row.hashinfo = &tcp_hashinfo; | 2464 | net->ipv4.tcp_death_row.hashinfo = &tcp_hashinfo; |
2464 | 2465 | ||
2466 | net->ipv4.sysctl_max_syn_backlog = max(128, cnt / 256); | ||
2467 | |||
2465 | return 0; | 2468 | return 0; |
2466 | fail: | 2469 | fail: |
2467 | tcp_sk_exit(net); | 2470 | tcp_sk_exit(net); |