Skip to content

Commit becb74f

Browse files
edumazetdavem330
authored andcommitted
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: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fa76ce7 commit becb74f

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎include/net/sock.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ struct sock {
405405
rwlock_t sk_callback_lock;
406406
int sk_err,
407407
sk_err_soft;
408-
unsigned short sk_ack_backlog;
409-
unsigned short sk_max_ack_backlog;
408+
u32 sk_ack_backlog;
409+
u32 sk_max_ack_backlog;
410410
__u32 sk_priority;
411411
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
412412
__u32 sk_cgrp_prioidx;

‎net/core/sysctl_net_core.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
static int zero = 0;
2626
static int one = 1;
27-
static int ushort_max = USHRT_MAX;
2827

2928
static int net_msg_warn; /* Unused, but still a sysctl */
3029

@@ -401,7 +400,6 @@ static struct ctl_table netns_core_table[] = {
401400
.maxlen = sizeof(int),
402401
.mode = 0644,
403402
.extra1 = &zero,
404-
.extra2 = &ushort_max,
405403
.proc_handler = proc_dointvec_minmax
406404
},
407405
{ }

0 commit comments

Comments
 (0)