aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2017-12-07 14:33:33 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-08 14:14:11 -0500
commit6065fd0d179b96ddc488c76542349bcb148a95fd (patch)
tree39472b7c1cc30a0ce316278fc8854101245b97b7 /net
parent428aec5e69fa17d223e1495f395833c50770f7ae (diff)
tcp: evaluate packet losses upon RTT change
RACK skips an ACK unless it advances the most recently delivered TX timestamp (rack.mstamp). Since RACK also uses the most recent RTT to decide if a packet is lost, RACK should still run the loss detection whenever the most recent RTT changes. For example, an ACK that does not advance the timestamp but triggers the cwnd undo due to reordering, would then use the most recent (higher) RTT measurement to detect further losses. Signed-off-by: Yuchung Cheng <ycheng@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Priyaranjan Jha <priyarjha@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_recovery.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c
index 0c182303e62e..3a81720ac0c4 100644
--- a/net/ipv4/tcp_recovery.c
+++ b/net/ipv4/tcp_recovery.c
@@ -117,13 +117,8 @@ void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
117{ 117{
118 u32 rtt_us; 118 u32 rtt_us;
119 119
120 if (tp->rack.mstamp &&
121 !tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
122 end_seq, tp->rack.end_seq))
123 return;
124
125 rtt_us = tcp_stamp_us_delta(tp->tcp_mstamp, xmit_time); 120 rtt_us = tcp_stamp_us_delta(tp->tcp_mstamp, xmit_time);
126 if (sacked & TCPCB_RETRANS) { 121 if (rtt_us < tcp_min_rtt(tp) && (sacked & TCPCB_RETRANS)) {
127 /* If the sacked packet was retransmitted, it's ambiguous 122 /* If the sacked packet was retransmitted, it's ambiguous
128 * whether the retransmission or the original (or the prior 123 * whether the retransmission or the original (or the prior
129 * retransmission) was sacked. 124 * retransmission) was sacked.
@@ -134,13 +129,15 @@ void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
134 * so it's at least one RTT (i.e., retransmission is at least 129 * so it's at least one RTT (i.e., retransmission is at least
135 * an RTT later). 130 * an RTT later).
136 */ 131 */
137 if (rtt_us < tcp_min_rtt(tp)) 132 return;
138 return;
139 } 133 }
140 tp->rack.rtt_us = rtt_us;
141 tp->rack.mstamp = xmit_time;
142 tp->rack.end_seq = end_seq;
143 tp->rack.advanced = 1; 134 tp->rack.advanced = 1;
135 tp->rack.rtt_us = rtt_us;
136 if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
137 end_seq, tp->rack.end_seq)) {
138 tp->rack.mstamp = xmit_time;
139 tp->rack.end_seq = end_seq;
140 }
144} 141}
145 142
146/* We have waited long enough to accommodate reordering. Mark the expired 143/* We have waited long enough to accommodate reordering. Mark the expired