aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-10-27 00:54:57 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-27 03:35:42 -0400
commite20223f1962831d1b1c416d59d259879d0639d68 (patch)
treea82676f59d21fe385c78d140c8cc43ee6b63ea67
parent2ae21cf527da0e5cf9d7ee14bd5b0909bb9d1a75 (diff)
tcp: Namespace-ify sysctl_tcp_recovery
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/netns/ipv4.h1
-rw-r--r--include/net/tcp.h2
-rw-r--r--net/ipv4/sysctl_net_ipv4.c14
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/tcp_ipv4.c1
-rw-r--r--net/ipv4/tcp_recovery.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index a7f39e3ea666..d6ed718075d4 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -129,6 +129,7 @@ struct netns_ipv4 {
129 int sysctl_tcp_window_scaling; 129 int sysctl_tcp_window_scaling;
130 int sysctl_tcp_timestamps; 130 int sysctl_tcp_timestamps;
131 int sysctl_tcp_early_retrans; 131 int sysctl_tcp_early_retrans;
132 int sysctl_tcp_recovery;
132 struct inet_timewait_death_row tcp_death_row; 133 struct inet_timewait_death_row tcp_death_row;
133 int sysctl_max_syn_backlog; 134 int sysctl_max_syn_backlog;
134 int sysctl_tcp_fastopen; 135 int sysctl_tcp_fastopen;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a12b71d4118b..c7f51534fc44 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -265,7 +265,7 @@ extern int sysctl_tcp_workaround_signed_windows;
265extern int sysctl_tcp_slow_start_after_idle; 265extern int sysctl_tcp_slow_start_after_idle;
266extern int sysctl_tcp_thin_linear_timeouts; 266extern int sysctl_tcp_thin_linear_timeouts;
267extern int sysctl_tcp_thin_dupack; 267extern int sysctl_tcp_thin_dupack;
268extern int sysctl_tcp_recovery; 268
269#define TCP_RACK_LOSS_DETECTION 0x1 /* Use RACK to detect losses */ 269#define TCP_RACK_LOSS_DETECTION 0x1 /* Use RACK to detect losses */
270 270
271extern int sysctl_tcp_limit_output_bytes; 271extern int sysctl_tcp_limit_output_bytes;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index f0f650f020af..78019adcae87 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -450,13 +450,6 @@ static struct ctl_table ipv4_table[] = {
450 .proc_handler = proc_dointvec 450 .proc_handler = proc_dointvec
451 }, 451 },
452 { 452 {
453 .procname = "tcp_recovery",
454 .data = &sysctl_tcp_recovery,
455 .maxlen = sizeof(int),
456 .mode = 0644,
457 .proc_handler = proc_dointvec,
458 },
459 {
460 .procname = "tcp_max_reordering", 453 .procname = "tcp_max_reordering",
461 .data = &sysctl_tcp_max_reordering, 454 .data = &sysctl_tcp_max_reordering,
462 .maxlen = sizeof(int), 455 .maxlen = sizeof(int),
@@ -1145,6 +1138,13 @@ static struct ctl_table ipv4_net_table[] = {
1145 .extra1 = &zero, 1138 .extra1 = &zero,
1146 .extra2 = &four, 1139 .extra2 = &four,
1147 }, 1140 },
1141 {
1142 .procname = "tcp_recovery",
1143 .data = &init_net.ipv4.sysctl_tcp_recovery,
1144 .maxlen = sizeof(int),
1145 .mode = 0644,
1146 .proc_handler = proc_dointvec,
1147 },
1148 { } 1148 { }
1149}; 1149};
1150 1150
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7656b1e6d504..5b2272dbf6a9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2788,7 +2788,7 @@ static void tcp_rack_identify_loss(struct sock *sk, int *ack_flag)
2788 struct tcp_sock *tp = tcp_sk(sk); 2788 struct tcp_sock *tp = tcp_sk(sk);
2789 2789
2790 /* Use RACK to detect loss */ 2790 /* Use RACK to detect loss */
2791 if (sysctl_tcp_recovery & TCP_RACK_LOSS_DETECTION) { 2791 if (sock_net(sk)->ipv4.sysctl_tcp_recovery & TCP_RACK_LOSS_DETECTION) {
2792 u32 prior_retrans = tp->retrans_out; 2792 u32 prior_retrans = tp->retrans_out;
2793 2793
2794 tcp_rack_mark_lost(sk); 2794 tcp_rack_mark_lost(sk);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 7ab313f6768e..517ff1948a71 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2485,6 +2485,7 @@ static int __net_init tcp_sk_init(struct net *net)
2485 net->ipv4.sysctl_tcp_window_scaling = 1; 2485 net->ipv4.sysctl_tcp_window_scaling = 1;
2486 net->ipv4.sysctl_tcp_timestamps = 1; 2486 net->ipv4.sysctl_tcp_timestamps = 1;
2487 net->ipv4.sysctl_tcp_early_retrans = 3; 2487 net->ipv4.sysctl_tcp_early_retrans = 3;
2488 net->ipv4.sysctl_tcp_recovery = TCP_RACK_LOSS_DETECTION;
2488 2489
2489 net->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE; 2490 net->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE;
2490 spin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock); 2491 spin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock);
diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c
index cda6074a429a..d3603a9e24ea 100644
--- a/net/ipv4/tcp_recovery.c
+++ b/net/ipv4/tcp_recovery.c
@@ -1,8 +1,6 @@
1#include <linux/tcp.h> 1#include <linux/tcp.h>
2#include <net/tcp.h> 2#include <net/tcp.h>
3 3
4int sysctl_tcp_recovery __read_mostly = TCP_RACK_LOSS_DETECTION;
5
6static void tcp_rack_mark_skb_lost(struct sock *sk, struct sk_buff *skb) 4static void tcp_rack_mark_skb_lost(struct sock *sk, struct sk_buff *skb)
7{ 5{
8 struct tcp_sock *tp = tcp_sk(sk); 6 struct tcp_sock *tp = tcp_sk(sk);