netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly
@ 2007-12-10 12:27 Ilpo Järvinen
  2007-12-10 12:31 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2007-12-10 12:27 UTC (permalink / raw)
  To: David Miller; +Cc: Netdev

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1679 bytes --]


Added checks will catch most of the errors if the current
complex fack_count counting logic is flawed somewhere.

Fackets_out should always be advancable if highest_sack is too
because the fackets_out is nowadays accurate (and obviously it
must be smaller than packets_out).

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/ipv4/tcp_input.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9499a12..23b2a34 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1270,24 +1270,28 @@ static int tcp_sacktag_one(struct sk_buff *skb, struct sock *sk,
 			}
 		}
 
-		if (!before(TCP_SKB_CB(skb)->seq, tcp_highest_sack_seq(tp)))
+		fack_count += tcp_skb_pcount(skb);
+		if (!before(TCP_SKB_CB(skb)->seq, tcp_highest_sack_seq(tp))) {
+			WARN_ON((fack_count <= tp->fackets_out) ||
+				(fack_count > tp->packets_out));
+
 			tcp_advance_highest_sack(sk, skb);
+			tp->fackets_out = fack_count;
+		} else
+			WARN_ON(fack_count > tp->fackets_out);
+
 		tcp_write_queue_requeue(skb, sk, TCP_WQ_SACKED);
 
 		TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED;
 		flag |= FLAG_DATA_SACKED;
 		tp->sacked_out += tcp_skb_pcount(skb);
 
-		fack_count += tcp_skb_pcount(skb);
-
 		/* Lost marker hint past SACKed? Tweak RFC3517 cnt */
 		if (!tcp_is_fack(tp) && (tp->lost_skb_hint != NULL) &&
 		    before(TCP_SKB_CB(skb)->seq,
 			   TCP_SKB_CB(tp->lost_skb_hint)->seq))
 			tp->lost_cnt_hint += tcp_skb_pcount(skb);
 
-		if (fack_count > tp->fackets_out)
-			tp->fackets_out = fack_count;
 	}
 
 	/* D-SACK. We can detect redundant retransmission in S|R and plain R
-- 
1.5.0.6

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

* Re: [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly
  2007-12-10 12:27 [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly Ilpo Järvinen
@ 2007-12-10 12:31 ` David Miller
  2007-12-10 12:39   ` Ilpo Järvinen
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2007-12-10 12:31 UTC (permalink / raw)
  To: ilpo.jarvinen; +Cc: netdev

From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Mon, 10 Dec 2007 14:27:24 +0200 (EET)

> Added checks will catch most of the errors if the current
> complex fack_count counting logic is flawed somewhere.
> 
> Fackets_out should always be advancable if highest_sack is too
> because the fackets_out is nowadays accurate (and obviously it
> must be smaller than packets_out).
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Applied to net-2.6.25, thanks!

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

* Re: [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly
  2007-12-10 12:31 ` David Miller
@ 2007-12-10 12:39   ` Ilpo Järvinen
  2007-12-10 23:55     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2007-12-10 12:39 UTC (permalink / raw)
  To: David Miller; +Cc: Netdev

[-- Attachment #1: Type: TEXT/PLAIN, Size: 722 bytes --]

On Mon, 10 Dec 2007, David Miller wrote:

> From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
> Date: Mon, 10 Dec 2007 14:27:24 +0200 (EET)
> 
> > Added checks will catch most of the errors if the current
> > complex fack_count counting logic is flawed somewhere.
> > 
> > Fackets_out should always be advancable if highest_sack is too
> > because the fackets_out is nowadays accurate (and obviously it
> > must be smaller than packets_out).
> > 
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> 
> Applied to net-2.6.25, thanks!

Please get the fack_count fix as well from the mm1 thread before my 
mailbox gets filled with stacktraces :-) :
  http://marc.info/?l=linux-netdev&m=119728952018975&w=2

-- 
 i.

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

* Re: [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly
  2007-12-10 12:39   ` Ilpo Järvinen
@ 2007-12-10 23:55     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2007-12-10 23:55 UTC (permalink / raw)
  To: ilpo.jarvinen; +Cc: netdev

From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Mon, 10 Dec 2007 14:39:46 +0200 (EET)

> On Mon, 10 Dec 2007, David Miller wrote:
> 
> > From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
> > Date: Mon, 10 Dec 2007 14:27:24 +0200 (EET)
> > 
> > > Added checks will catch most of the errors if the current
> > > complex fack_count counting logic is flawed somewhere.
> > > 
> > > Fackets_out should always be advancable if highest_sack is too
> > > because the fackets_out is nowadays accurate (and obviously it
> > > must be smaller than packets_out).
> > > 
> > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> > 
> > Applied to net-2.6.25, thanks!
> 
> Please get the fack_count fix as well from the mm1 thread before my 
> mailbox gets filled with stacktraces :-) :
>   http://marc.info/?l=linux-netdev&m=119728952018975&w=2

Done, thanks!

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

end of thread, other threads:[~2007-12-10 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-10 12:27 [PATCH] [TCP]: Bind fackets_out state to highest_sack more tightly Ilpo Järvinen
2007-12-10 12:31 ` David Miller
2007-12-10 12:39   ` Ilpo Järvinen
2007-12-10 23:55     ` 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).