Skip to content

Commit 179ac35

Browse files
yuchungchengdavem330
authored andcommitted
tcp: consistently check retransmit hint
tcp_simple_retransmit() used for path MTU discovery may not adjust the retransmit hint properly by deducting retrans_out before checking it to adjust the hint. This patch fixes this by a correct routine tcp_mark_skb_lost() already used by the RACK loss detection. 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 b4f4348 commit 179ac35

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

net/ipv4/tcp_input.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,13 +2675,8 @@ void tcp_simple_retransmit(struct sock *sk)
26752675

26762676
skb_rbtree_walk(skb, &sk->tcp_rtx_queue) {
26772677
if (tcp_skb_seglen(skb) > mss &&
2678-
!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
2679-
if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
2680-
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
2681-
tp->retrans_out -= tcp_skb_pcount(skb);
2682-
}
2683-
tcp_skb_mark_lost_uncond_verify(tp, skb);
2684-
}
2678+
!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
2679+
tcp_mark_skb_lost(sk, skb);
26852680
}
26862681

26872682
tcp_clear_retrans_hints_partial(tp);

net/ipv4/tcp_recovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,6 @@ void tcp_newreno_mark_lost(struct sock *sk, bool snd_una_advanced)
246246
tcp_fragment(sk, TCP_FRAG_IN_RTX_QUEUE, skb,
247247
mss, mss, GFP_ATOMIC);
248248

249-
tcp_skb_mark_lost_uncond_verify(tp, skb);
249+
tcp_mark_skb_lost(sk, skb);
250250
}
251251
}

0 commit comments

Comments
 (0)