aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2013-05-29 10:20:14 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-30 21:06:11 -0400
commitc7d9d6a185a7ea383b719b79c428d34ec1470275 (patch)
tree8be2c4373f514efe7b3bdf599621e256ac836609 /net/ipv4/tcp_input.c
parent7026b912f97d912476dff5465ed9a127be094208 (diff)
tcp: undo on DSACK during recovery
If the receiver supports DSACK, sender can detect false recoveries and revert cwnd reductions triggered by either severe network reordering or concurrent reordering and loss event. Signed-off-by: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c35b22751982..907311c9a012 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2315,7 +2315,7 @@ static bool tcp_try_undo_recovery(struct sock *sk)
2315} 2315}
2316 2316
2317/* Try to undo cwnd reduction, because D-SACKs acked all retransmitted data */ 2317/* Try to undo cwnd reduction, because D-SACKs acked all retransmitted data */
2318static void tcp_try_undo_dsack(struct sock *sk) 2318static bool tcp_try_undo_dsack(struct sock *sk)
2319{ 2319{
2320 struct tcp_sock *tp = tcp_sk(sk); 2320 struct tcp_sock *tp = tcp_sk(sk);
2321 2321
@@ -2323,7 +2323,9 @@ static void tcp_try_undo_dsack(struct sock *sk)
2323 DBGUNDO(sk, "D-SACK"); 2323 DBGUNDO(sk, "D-SACK");
2324 tcp_undo_cwnd_reduction(sk, false); 2324 tcp_undo_cwnd_reduction(sk, false);
2325 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDSACKUNDO); 2325 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDSACKUNDO);
2326 return true;
2326 } 2327 }
2328 return false;
2327} 2329}
2328 2330
2329/* We can clear retrans_stamp when there are no retransmissions in the 2331/* We can clear retrans_stamp when there are no retransmissions in the
@@ -2751,6 +2753,10 @@ static void tcp_fastretrans_alert(struct sock *sk, const int acked,
2751 do_lost = tcp_is_reno(tp) || 2753 do_lost = tcp_is_reno(tp) ||
2752 tcp_fackets_out(tp) > tp->reordering; 2754 tcp_fackets_out(tp) > tp->reordering;
2753 } 2755 }
2756 if (tcp_try_undo_dsack(sk)) {
2757 tcp_try_keep_open(sk);
2758 return;
2759 }
2754 break; 2760 break;
2755 case TCP_CA_Loss: 2761 case TCP_CA_Loss:
2756 tcp_process_loss(sk, flag, is_dupack); 2762 tcp_process_loss(sk, flag, is_dupack);