Skip to content

Commit

Permalink
tcp: consistently check retransmit hint
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Yuchung Cheng authored and David S. Miller committed Sep 26, 2020
1 parent b4f4348 commit 179ac35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2675,13 +2675,8 @@ void tcp_simple_retransmit(struct sock *sk)

skb_rbtree_walk(skb, &sk->tcp_rtx_queue) {
if (tcp_skb_seglen(skb) > mss &&
!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
tp->retrans_out -= tcp_skb_pcount(skb);
}
tcp_skb_mark_lost_uncond_verify(tp, skb);
}
!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
tcp_mark_skb_lost(sk, skb);
}

tcp_clear_retrans_hints_partial(tp);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/tcp_recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,6 @@ void tcp_newreno_mark_lost(struct sock *sk, bool snd_una_advanced)
tcp_fragment(sk, TCP_FRAG_IN_RTX_QUEUE, skb,
mss, mss, GFP_ATOMIC);

tcp_skb_mark_lost_uncond_verify(tp, skb);
tcp_mark_skb_lost(sk, skb);
}
}

0 comments on commit 179ac35

Please sign in to comment.