netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix TSO FACK loss marking in tcp_mark_head_lost
@ 2010-09-24 23:22 Yuchung Cheng
  2010-09-27 12:22 ` Ilpo Järvinen
  0 siblings, 1 reply; 5+ messages in thread
From: Yuchung Cheng @ 2010-09-24 23:22 UTC (permalink / raw)
  To: ilpo.jarvinen, davem; +Cc: netdev, Yuchung Cheng

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>
---
 net/ipv4/tcp_input.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 1bc87a0..e4f472e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2532,7 +2532,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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-27 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 23:22 [PATCH] fix TSO FACK loss marking in tcp_mark_head_lost Yuchung Cheng
2010-09-27 12:22 ` Ilpo Järvinen
2010-09-27 18:11   ` David Miller
2010-09-27 19:20     ` Ilpo Järvinen
2010-09-27 21:56       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).