瀏覽代碼

tcp: fix TSO FACK loss marking in tcp_mark_head_lost

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>
Yuchung Cheng 15 年之前
父節點
當前提交
b3de7559af
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      net/ipv4/tcp_input.c

+ 2 - 1
net/ipv4/tcp_input.c

@@ -2545,7 +2545,8 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)
 			cnt += tcp_skb_pcount(skb);
 			cnt += tcp_skb_pcount(skb);
 
 
 		if (cnt > packets) {
 		if (cnt > packets) {
-			if (tcp_is_sack(tp) || (oldcnt >= packets))
+			if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) ||
+			    (oldcnt >= packets))
 				break;
 				break;
 
 
 			mss = skb_shinfo(skb)->gso_size;
 			mss = skb_shinfo(skb)->gso_size;