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

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

ipv4: Namespaceify tcp_tw_recycle and tcp_max_tw_buckets knob



Different namespace application might require fast recycling
TIME-WAIT sockets independently of the host.

Signed-off-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 801822d1
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -29,16 +29,6 @@

#include <linux/atomic.h>

struct inet_hashinfo;

struct inet_timewait_death_row {
	atomic_t		tw_count;

	struct inet_hashinfo 	*hashinfo ____cacheline_aligned_in_smp;
	int			sysctl_tw_recycle;
	int			sysctl_max_tw_buckets;
};

struct inet_bind_bucket;

/*
@@ -125,8 +115,7 @@ static inline void inet_twsk_reschedule(struct inet_timewait_sock *tw, int timeo

void inet_twsk_deschedule_put(struct inet_timewait_sock *tw);

void inet_twsk_purge(struct inet_hashinfo *hashinfo,
		     struct inet_timewait_death_row *twdr, int family);
void inet_twsk_purge(struct inet_hashinfo *hashinfo, int family);

static inline
struct net *twsk_net(const struct inet_timewait_sock *twsk)
+11 −0
Original line number Diff line number Diff line
@@ -27,6 +27,16 @@ struct ping_group_range {
	kgid_t		range[2];
};

struct inet_hashinfo;

struct inet_timewait_death_row {
	atomic_t		tw_count;

	struct inet_hashinfo 	*hashinfo ____cacheline_aligned_in_smp;
	int			sysctl_tw_recycle;
	int			sysctl_max_tw_buckets;
};

struct netns_ipv4 {
#ifdef CONFIG_SYSCTL
	struct ctl_table_header	*forw_hdr;
@@ -111,6 +121,7 @@ struct netns_ipv4 {
	int sysctl_tcp_fin_timeout;
	unsigned int sysctl_tcp_notsent_lowat;
	int sysctl_tcp_tw_reuse;
	struct inet_timewait_death_row tcp_death_row;

	int sysctl_igmp_max_memberships;
	int sysctl_igmp_max_msf;
+0 −1
Original line number Diff line number Diff line
@@ -231,7 +231,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
 */
#define	TFO_SERVER_WO_SOCKOPT1	0x400

extern struct inet_timewait_death_row tcp_death_row;

/* sysctl variables for tcp */
extern int sysctl_tcp_timestamps;
+0 −2
Original line number Diff line number Diff line
@@ -1831,8 +1831,6 @@ static int __init inet_init(void)

	ip_init();

	tcp_v4_init();

	/* Setup TCP slab cache for open requests. */
	tcp_init();

+1 −2
Original line number Diff line number Diff line
@@ -257,8 +257,7 @@ void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo, bool rearm)
}
EXPORT_SYMBOL_GPL(__inet_twsk_schedule);

void inet_twsk_purge(struct inet_hashinfo *hashinfo,
		     struct inet_timewait_death_row *twdr, int family)
void inet_twsk_purge(struct inet_hashinfo *hashinfo, int family)
{
	struct inet_timewait_sock *tw;
	struct sock *sk;
Loading