Skip to content

Commit 9e45a3e

Browse files
yuchungchengdavem330
authored andcommitted
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: 5b08e47 ("tcp: prefer packet timing to TS-ECR for RTT") Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c8fdc32 commit 9e45a3e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,9 +2925,6 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
29252925
* Karn's algorithm forbids taking RTT if some retransmitted data
29262926
* is acked (RFC6298).
29272927
*/
2928-
if (flag & FLAG_RETRANS_DATA_ACKED)
2929-
seq_rtt_us = -1L;
2930-
29312928
if (seq_rtt_us < 0)
29322929
seq_rtt_us = sack_rtt_us;
29332930

@@ -3169,7 +3166,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
31693166
flag |= FLAG_SACK_RENEGING;
31703167

31713168
skb_mstamp_get(&now);
3172-
if (likely(first_ackt.v64)) {
3169+
if (likely(first_ackt.v64) && !(flag & FLAG_RETRANS_DATA_ACKED)) {
31733170
seq_rtt_us = skb_mstamp_us_delta(&now, &first_ackt);
31743171
ca_rtt_us = skb_mstamp_us_delta(&now, &last_ackt);
31753172
}

0 commit comments

Comments
 (0)