Commit becb74f0 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: increase sk_[max_]ack_backlog

sk_ack_backlog & sk_max_ack_backlog were 16bit fields, meaning
listen() backlog was limited to 65535.

It is time to increase the width to allow much bigger backlog,
if admins change /proc/sys/net/core/somaxconn &
/proc/sys/net/ipv4/tcp_max_syn_backlog default values.

Tested:

echo 5000000 >/proc/sys/net/core/somaxconn
echo 5000000 >/proc/sys/net/ipv4/tcp_max_syn_backlog

Ran a SYNFLOOD test against a listener using listen(fd, 5000000)

myhost~# grep request_sock_TCP /proc/slabinfo
request_sock_TCP  4185642 4411940    304   13    1 : tunables   54   27    8 : slabdata 339380 339380      0
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa76ce73
...@@ -405,8 +405,8 @@ struct sock { ...@@ -405,8 +405,8 @@ struct sock {
rwlock_t sk_callback_lock; rwlock_t sk_callback_lock;
int sk_err, int sk_err,
sk_err_soft; sk_err_soft;
unsigned short sk_ack_backlog; u32 sk_ack_backlog;
unsigned short sk_max_ack_backlog; u32 sk_max_ack_backlog;
__u32 sk_priority; __u32 sk_priority;
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
__u32 sk_cgrp_prioidx; __u32 sk_cgrp_prioidx;
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
static int zero = 0; static int zero = 0;
static int one = 1; static int one = 1;
static int ushort_max = USHRT_MAX;
static int net_msg_warn; /* Unused, but still a sysctl */ static int net_msg_warn; /* Unused, but still a sysctl */
...@@ -401,7 +400,6 @@ static struct ctl_table netns_core_table[] = { ...@@ -401,7 +400,6 @@ static struct ctl_table netns_core_table[] = {
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.extra1 = &zero, .extra1 = &zero,
.extra2 = &ushort_max,
.proc_handler = proc_dointvec_minmax .proc_handler = proc_dointvec_minmax
}, },
{ } { }
......
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