aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2015-10-17 00:57:41 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-21 10:00:41 -0400
commit9e45a3e36b363cc4c79c70f2b4f994e66543a219 (patch)
tree7294db10f64aede08fd0225347293b32075fdd68 /net/ipv4/tcp_input.c
parentc8fdc324916a864de753db6de6423b048c20cc0f (diff)
tcp: apply Kern's check on RTTs used for congestion control
Currently ca_seq_rtt_us does not use Kern's check. Fix that by checking if any packet acked is a retransmit, for both RTT used for RTT estimation and congestion control. Fixes: 5b08e47ca ("tcp: prefer packet timing to TS-ECR for RTT") Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Eric Dumazet <edumazet@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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 944eaca69115..62ee71efd1ce 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2925,9 +2925,6 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
2925 * Karn's algorithm forbids taking RTT if some retransmitted data 2925 * Karn's algorithm forbids taking RTT if some retransmitted data
2926 * is acked (RFC6298). 2926 * is acked (RFC6298).
2927 */ 2927 */
2928 if (flag & FLAG_RETRANS_DATA_ACKED)
2929 seq_rtt_us = -1L;
2930
2931 if (seq_rtt_us < 0) 2928 if (seq_rtt_us < 0)
2932 seq_rtt_us = sack_rtt_us; 2929 seq_rtt_us = sack_rtt_us;
2933 2930
@@ -3169,7 +3166,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
3169 flag |= FLAG_SACK_RENEGING; 3166 flag |= FLAG_SACK_RENEGING;
3170 3167
3171 skb_mstamp_get(&now); 3168 skb_mstamp_get(&now);
3172 if (likely(first_ackt.v64)) { 3169 if (likely(first_ackt.v64) && !(flag & FLAG_RETRANS_DATA_ACKED)) {
3173 seq_rtt_us = skb_mstamp_us_delta(&now, &first_ackt); 3170 seq_rtt_us = skb_mstamp_us_delta(&now, &first_ackt);
3174 ca_rtt_us = skb_mstamp_us_delta(&now, &last_ackt); 3171 ca_rtt_us = skb_mstamp_us_delta(&now, &last_ackt);
3175 } 3172 }