diff options
-rw-r--r-- | include/net/netns/ipv4.h | 1 | ||||
-rw-r--r-- | include/net/tcp.h | 1 | ||||
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 14 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 1 |
5 files changed, 10 insertions, 10 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 537830882149..e52c2124b32e 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -151,6 +151,7 @@ struct netns_ipv4 { | |||
151 | int sysctl_tcp_min_tso_segs; | 151 | int sysctl_tcp_min_tso_segs; |
152 | int sysctl_tcp_min_rtt_wlen; | 152 | int sysctl_tcp_min_rtt_wlen; |
153 | int sysctl_tcp_autocorking; | 153 | int sysctl_tcp_autocorking; |
154 | int sysctl_tcp_invalid_ratelimit; | ||
154 | struct inet_timewait_death_row tcp_death_row; | 155 | struct inet_timewait_death_row tcp_death_row; |
155 | int sysctl_max_syn_backlog; | 156 | int sysctl_max_syn_backlog; |
156 | int sysctl_tcp_fastopen; | 157 | int sysctl_tcp_fastopen; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 0268f1025d9d..5869a822ecb1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -250,7 +250,6 @@ extern int sysctl_tcp_rmem[3]; | |||
250 | 250 | ||
251 | #define TCP_RACK_LOSS_DETECTION 0x1 /* Use RACK to detect losses */ | 251 | #define TCP_RACK_LOSS_DETECTION 0x1 /* Use RACK to detect losses */ |
252 | 252 | ||
253 | extern int sysctl_tcp_invalid_ratelimit; | ||
254 | extern int sysctl_tcp_pacing_ss_ratio; | 253 | extern int sysctl_tcp_pacing_ss_ratio; |
255 | extern int sysctl_tcp_pacing_ca_ratio; | 254 | extern int sysctl_tcp_pacing_ca_ratio; |
256 | 255 | ||
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 43a18a317053..6a9349c27f00 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -511,13 +511,6 @@ static struct ctl_table ipv4_table[] = { | |||
511 | .extra2 = &thousand, | 511 | .extra2 = &thousand, |
512 | }, | 512 | }, |
513 | { | 513 | { |
514 | .procname = "tcp_invalid_ratelimit", | ||
515 | .data = &sysctl_tcp_invalid_ratelimit, | ||
516 | .maxlen = sizeof(int), | ||
517 | .mode = 0644, | ||
518 | .proc_handler = proc_dointvec_ms_jiffies, | ||
519 | }, | ||
520 | { | ||
521 | .procname = "tcp_available_ulp", | 514 | .procname = "tcp_available_ulp", |
522 | .maxlen = TCP_ULP_BUF_MAX, | 515 | .maxlen = TCP_ULP_BUF_MAX, |
523 | .mode = 0444, | 516 | .mode = 0444, |
@@ -1145,6 +1138,13 @@ static struct ctl_table ipv4_net_table[] = { | |||
1145 | .extra1 = &zero, | 1138 | .extra1 = &zero, |
1146 | .extra2 = &one, | 1139 | .extra2 = &one, |
1147 | }, | 1140 | }, |
1141 | { | ||
1142 | .procname = "tcp_invalid_ratelimit", | ||
1143 | .data = &init_net.ipv4.sysctl_tcp_invalid_ratelimit, | ||
1144 | .maxlen = sizeof(int), | ||
1145 | .mode = 0644, | ||
1146 | .proc_handler = proc_dointvec_ms_jiffies, | ||
1147 | }, | ||
1148 | { } | 1148 | { } |
1149 | }; | 1149 | }; |
1150 | 1150 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index da1ef666d1f9..db4d458d0205 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -80,7 +80,6 @@ | |||
80 | #include <linux/static_key.h> | 80 | #include <linux/static_key.h> |
81 | 81 | ||
82 | int sysctl_tcp_max_orphans __read_mostly = NR_FILE; | 82 | int sysctl_tcp_max_orphans __read_mostly = NR_FILE; |
83 | int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2; | ||
84 | 83 | ||
85 | #define FLAG_DATA 0x01 /* Incoming frame contained data. */ | 84 | #define FLAG_DATA 0x01 /* Incoming frame contained data. */ |
86 | #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ | 85 | #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ |
@@ -3403,7 +3402,7 @@ static bool __tcp_oow_rate_limited(struct net *net, int mib_idx, | |||
3403 | if (*last_oow_ack_time) { | 3402 | if (*last_oow_ack_time) { |
3404 | s32 elapsed = (s32)(tcp_jiffies32 - *last_oow_ack_time); | 3403 | s32 elapsed = (s32)(tcp_jiffies32 - *last_oow_ack_time); |
3405 | 3404 | ||
3406 | if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) { | 3405 | if (0 <= elapsed && elapsed < net->ipv4.sysctl_tcp_invalid_ratelimit) { |
3407 | NET_INC_STATS(net, mib_idx); | 3406 | NET_INC_STATS(net, mib_idx); |
3408 | return true; /* rate-limited: don't send yet! */ | 3407 | return true; /* rate-limited: don't send yet! */ |
3409 | } | 3408 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 351e3497c8f3..6617aae18ba2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2506,6 +2506,7 @@ static int __net_init tcp_sk_init(struct net *net) | |||
2506 | net->ipv4.sysctl_tcp_min_tso_segs = 2; | 2506 | net->ipv4.sysctl_tcp_min_tso_segs = 2; |
2507 | net->ipv4.sysctl_tcp_min_rtt_wlen = 300; | 2507 | net->ipv4.sysctl_tcp_min_rtt_wlen = 300; |
2508 | net->ipv4.sysctl_tcp_autocorking = 1; | 2508 | net->ipv4.sysctl_tcp_autocorking = 1; |
2509 | net->ipv4.sysctl_tcp_invalid_ratelimit = HZ/2; | ||
2509 | 2510 | ||
2510 | net->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE; | 2511 | net->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE; |
2511 | spin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock); | 2512 | spin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock); |