aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2017-11-14 11:25:49 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-15 00:09:52 -0500
commit6670e152447732ba90626f36dfc015a13fbf150e (patch)
tree0848d15b1d27139ee651c8ecae0136bb679f205a /net/ipv4/tcp_ipv4.c
parent11bf284f81b46f59d5f4a4522c13aa7852cfd560 (diff)
tcp: Namespace-ify sysctl_tcp_default_congestion_control
Make default TCP default congestion control to a per namespace value. This changes default congestion control to a pointer to congestion ops (rather than implicit as first element of available lsit). The congestion control setting of new namespaces is inherited from the current setting of the root namespace. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1eac84b8044e..c6bc0c4d19c6 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2430,6 +2430,8 @@ static void __net_exit tcp_sk_exit(struct net *net)
2430{ 2430{
2431 int cpu; 2431 int cpu;
2432 2432
2433 module_put(net->ipv4.tcp_congestion_control->owner);
2434
2433 for_each_possible_cpu(cpu) 2435 for_each_possible_cpu(cpu)
2434 inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.tcp_sk, cpu)); 2436 inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.tcp_sk, cpu));
2435 free_percpu(net->ipv4.tcp_sk); 2437 free_percpu(net->ipv4.tcp_sk);
@@ -2522,6 +2524,13 @@ static int __net_init tcp_sk_init(struct net *net)
2522 net->ipv4.sysctl_tcp_fastopen_blackhole_timeout = 60 * 60; 2524 net->ipv4.sysctl_tcp_fastopen_blackhole_timeout = 60 * 60;
2523 atomic_set(&net->ipv4.tfo_active_disable_times, 0); 2525 atomic_set(&net->ipv4.tfo_active_disable_times, 0);
2524 2526
2527 /* Reno is always built in */
2528 if (!net_eq(net, &init_net) &&
2529 try_module_get(init_net.ipv4.tcp_congestion_control->owner))
2530 net->ipv4.tcp_congestion_control = init_net.ipv4.tcp_congestion_control;
2531 else
2532 net->ipv4.tcp_congestion_control = &tcp_reno;
2533
2525 return 0; 2534 return 0;
2526fail: 2535fail:
2527 tcp_sk_exit(net); 2536 tcp_sk_exit(net);