[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1302041327210.4561@wel-95.cs.helsinki.fi>
Date: Mon, 4 Feb 2013 14:14:25 +0200 (EET)
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Neal Cardwell <ncardwell@...gle.com>,
"Pasi Kärkkäinen" <pasik@....fi>,
David Miller <davem@...emloft.net>,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Stephen Hemminger <stephen@...workplumber.org>,
Netdev <netdev@...r.kernel.org>,
Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH] tcp: frto should not set snd_cwnd to 0
On Sun, 3 Feb 2013, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start())
> uncovered a bug in FRTO code :
> tcp_process_frto() is setting snd_cwnd to 0 if the number
> of in flight packets is 0.
>
> As Neal pointed out, if no packet is in flight we lost our
> chance to disambiguate whether a loss timeout was spurious.
>
> We should assume it was a proper loss.
>
> Reported-by: Pasi Kärkkäinen <pasik@....fi>
> Signed-off-by: Neal Cardwell <ncardwell@...gle.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
> Cc: Yuchung Cheng <ycheng@...gle.com>
> ---
> net/ipv4/tcp_input.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 8aca4ee..680c422 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3484,7 +3484,8 @@ static bool tcp_process_frto(struct sock *sk, int flag)
> ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED)))
> tp->undo_marker = 0;
>
> - if (!before(tp->snd_una, tp->frto_highmark)) {
> + if (!before(tp->snd_una, tp->frto_highmark) ||
> + !tcp_packets_in_flight(tp)) {
I think this condition becomes now too broad because there is transient
during FRTO. I think the patch below would be enough to resolve this,
what do you think?
--
[PATCH 1/1] tcp: fix for zero packets_in_flight was too broad
There are transients during normal FRTO procedure during which
the packets_in_flight can go to zero between write_queue state
updates and firing the resulting segments out. As FRTO processing
occurs during that window the check must be more precise to
not match "spuriously" :-). More specificly, e.g., when
packets_in_flight is zero but FLAG_DATA_ACKED is true the problematic
branch that set cwnd into zero would not be taken and new segments
might be sent out later.
Only compile tested.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
Cc: Neal Cardwell <ncardwell@...gle.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: Pasi Kärkkäinen <pasik@....fi>
---
net/ipv4/tcp_input.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 680c422..500c2da 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3484,8 +3484,7 @@ static bool tcp_process_frto(struct sock *sk, int flag)
((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED)))
tp->undo_marker = 0;
- if (!before(tp->snd_una, tp->frto_highmark) ||
- !tcp_packets_in_flight(tp)) {
+ if (!before(tp->snd_una, tp->frto_highmark)) {
tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), flag);
return true;
}
@@ -3505,6 +3504,11 @@ static bool tcp_process_frto(struct sock *sk, int flag)
}
} else {
if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) {
+ if (!tcp_packets_in_flight(tp)) {
+ tcp_enter_frto_loss(sk, 2, flag);
+ return true;
+ }
+
/* Prevent sending of new data. */
tp->snd_cwnd = min(tp->snd_cwnd,
tcp_packets_in_flight(tp));
--
1.7.0.4
Powered by blists - more mailing lists