aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2018-05-16 19:40:11 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-17 15:41:28 -0400
commitb38a51fec1c1f693f03b1aa19d0622123634d4b7 (patch)
tree2dfede58dae59faf7da205143e3e00e1833e4bc7
parent20b654dfe1beaca60ab51894ff405a049248433d (diff)
tcp: disable RFC6675 loss detection
This patch disables RFC6675 loss detection and make sysctl net.ipv4.tcp_recovery = 1 controls a binary choice between RACK (1) or RFC6675 (0). Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Priyaranjan Jha <priyarjha@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/ip-sysctl.txt3
-rw-r--r--net/ipv4/tcp_input.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 13bbac50dc8b..ea304a23c8d7 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -449,7 +449,8 @@ tcp_recovery - INTEGER
449 features. 449 features.
450 450
451 RACK: 0x1 enables the RACK loss detection for fast detection of lost 451 RACK: 0x1 enables the RACK loss detection for fast detection of lost
452 retransmissions and tail drops. 452 retransmissions and tail drops. It also subsumes and disables
453 RFC6675 recovery for SACK connections.
453 RACK: 0x2 makes RACK's reordering window static (min_rtt/4). 454 RACK: 0x2 makes RACK's reordering window static (min_rtt/4).
454 RACK: 0x4 disables RACK's DUPACK threshold heuristic 455 RACK: 0x4 disables RACK's DUPACK threshold heuristic
455 456
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b188e0d75edd..ccbe04f80040 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2035,6 +2035,11 @@ static inline int tcp_dupack_heuristics(const struct tcp_sock *tp)
2035 return tp->sacked_out + 1; 2035 return tp->sacked_out + 1;
2036} 2036}
2037 2037
2038static bool tcp_is_rack(const struct sock *sk)
2039{
2040 return sock_net(sk)->ipv4.sysctl_tcp_recovery & TCP_RACK_LOSS_DETECTION;
2041}
2042
2038/* Linux NewReno/SACK/ECN state machine. 2043/* Linux NewReno/SACK/ECN state machine.
2039 * -------------------------------------- 2044 * --------------------------------------
2040 * 2045 *
@@ -2141,7 +2146,7 @@ static bool tcp_time_to_recover(struct sock *sk, int flag)
2141 return true; 2146 return true;
2142 2147
2143 /* Not-A-Trick#2 : Classic rule... */ 2148 /* Not-A-Trick#2 : Classic rule... */
2144 if (tcp_dupack_heuristics(tp) > tp->reordering) 2149 if (!tcp_is_rack(sk) && tcp_dupack_heuristics(tp) > tp->reordering)
2145 return true; 2150 return true;
2146 2151
2147 return false; 2152 return false;
@@ -2722,8 +2727,7 @@ static void tcp_rack_identify_loss(struct sock *sk, int *ack_flag)
2722{ 2727{
2723 struct tcp_sock *tp = tcp_sk(sk); 2728 struct tcp_sock *tp = tcp_sk(sk);
2724 2729
2725 /* Use RACK to detect loss */ 2730 if (tcp_is_rack(sk)) {
2726 if (sock_net(sk)->ipv4.sysctl_tcp_recovery & TCP_RACK_LOSS_DETECTION) {
2727 u32 prior_retrans = tp->retrans_out; 2731 u32 prior_retrans = tp->retrans_out;
2728 2732
2729 tcp_rack_mark_lost(sk); 2733 tcp_rack_mark_lost(sk);
@@ -2862,7 +2866,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,
2862 fast_rexmit = 1; 2866 fast_rexmit = 1;
2863 } 2867 }
2864 2868
2865 if (do_lost) 2869 if (!tcp_is_rack(sk) && do_lost)
2866 tcp_update_scoreboard(sk, fast_rexmit); 2870 tcp_update_scoreboard(sk, fast_rexmit);
2867 *rexmit = REXMIT_LOST; 2871 *rexmit = REXMIT_LOST;
2868} 2872}