Skip to content

Commit

Permalink
tcp: fix TSO FACK loss marking in tcp_mark_head_lost
Browse files Browse the repository at this point in the history
When TCP uses FACK algorithm to mark lost packets in
tcp_mark_head_lost(), if the number of packets in the (TSO) skb is
greater than the number of packets that should be marked lost, TCP
incorrectly exits the loop and marks no packets lost in the skb. This
underestimates tp->lost_out and affects the recovery/retransmission.
This patch fargments the skb and marks the correct amount of packets
lost.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yuchung Cheng authored and David S. Miller committed Sep 27, 2010
1 parent 3fd6c88 commit b3de755
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2545,7 +2545,8 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)
cnt += tcp_skb_pcount(skb);

if (cnt > packets) {
if (tcp_is_sack(tp) || (oldcnt >= packets))
if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) ||
(oldcnt >= packets))
break;

mss = skb_shinfo(skb)->gso_size;
Expand Down

0 comments on commit b3de755

Please sign in to comment.