Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fee83d09 authored by Haishuang Yan's avatar Haishuang Yan Committed by David S. Miller
Browse files

ipv4: Namespaceify tcp_max_syn_backlog knob



Different namespace application might require different maximal
number of remembered connection requests.

Signed-off-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1946e672
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ struct netns_ipv4 {
	unsigned int sysctl_tcp_notsent_lowat;
	int sysctl_tcp_tw_reuse;
	struct inet_timewait_death_row tcp_death_row;
	int sysctl_max_syn_backlog;

	int sysctl_igmp_max_memberships;
	int sysctl_igmp_max_msf;
+1 −3
Original line number Diff line number Diff line
@@ -123,8 +123,6 @@ static inline void reqsk_put(struct request_sock *req)
		reqsk_free(req);
}

extern int sysctl_max_syn_backlog;

/*
 * For a TCP Fast Open listener -
 *	lock - protects the access to all the reqsk, which is co-owned by
+0 −2
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@
 * and it will increase in proportion to the memory of machine.
 * Note : Dont forget somaxconn that may limit backlog too.
 */
int sysctl_max_syn_backlog = 256;
EXPORT_SYMBOL(sysctl_max_syn_backlog);

void reqsk_queue_alloc(struct request_sock_queue *queue)
{
+7 −7
Original line number Diff line number Diff line
@@ -323,13 +323,6 @@ static struct ctl_table ipv4_table[] = {
		.mode		= 0644,
		.proc_handler	= proc_dointvec
	},
	{
		.procname	= "tcp_max_syn_backlog",
		.data		= &sysctl_max_syn_backlog,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec
	},
	{
		.procname	= "inet_peer_threshold",
		.data		= &inet_peer_threshold,
@@ -960,6 +953,13 @@ static struct ctl_table ipv4_net_table[] = {
		.mode		= 0644,
		.proc_handler	= proc_dointvec
	},
	{
		.procname	= "tcp_max_syn_backlog",
		.data		= &init_net.ipv4.sysctl_max_syn_backlog,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec
	},
#ifdef CONFIG_IP_ROUTE_MULTIPATH
	{
		.procname	= "fib_multipath_use_neigh",
+0 −2
Original line number Diff line number Diff line
@@ -3378,9 +3378,7 @@ void __init tcp_init(void)


	cnt = tcp_hashinfo.ehash_mask + 1;

	sysctl_tcp_max_orphans = cnt / 2;
	sysctl_max_syn_backlog = max(128, cnt / 256);

	tcp_init_mem();
	/* Set per-socket limits to no more than 1/128 the pressure threshold */
Loading