All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
@ 2012-04-30 16:00 Yuchung Cheng
  2012-04-30 16:25 ` Neal Cardwell
  0 siblings, 1 reply; 3+ messages in thread
From: Yuchung Cheng @ 2012-04-30 16:00 UTC (permalink / raw)
  To: davem, ilpo.jarvinen, ncardwell; +Cc: nanditad, netdev, Yuchung Cheng

When the cwnd reduction is done, ssthresh may be infinite
if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
infinite ssthresh value. The correct operation is to keep cwnd
intact because it has been updated in ECN or F-RTO.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
---
ChangeLog since v1:
 - Add snd_cwnd_stamp timestamping in CWR mode

 net/ipv4/tcp_input.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c93b0cb..e0a9b89 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2868,11 +2868,14 @@ static inline void tcp_complete_cwr(struct sock *sk)
 
 	/* Do not moderate cwnd if it's already undone in cwr or recovery. */
 	if (tp->undo_marker) {
-		if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR)
+		if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR) {
 			tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
-		else /* PRR */
+			tp->snd_cwnd_stamp = tcp_time_stamp;
+		} else if (tp->snd_ssthresh < TCP_INFINITE_SSTHRESH) {
+			/* PRR algorithm. */
 			tp->snd_cwnd = tp->snd_ssthresh;
-		tp->snd_cwnd_stamp = tcp_time_stamp;
+			tp->snd_cwnd_stamp = tcp_time_stamp;
+		}
 	}
 	tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
 }
-- 
1.7.7.3

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

* Re: [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
  2012-04-30 16:00 [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr() Yuchung Cheng
@ 2012-04-30 16:25 ` Neal Cardwell
  2012-04-30 17:45   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Neal Cardwell @ 2012-04-30 16:25 UTC (permalink / raw)
  To: Yuchung Cheng; +Cc: davem, ilpo.jarvinen, nanditad, netdev

On Mon, Apr 30, 2012 at 12:00 PM, Yuchung Cheng <ycheng@google.com> wrote:
> When the cwnd reduction is done, ssthresh may be infinite
> if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
> undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
> infinite ssthresh value. The correct operation is to keep cwnd
> intact because it has been updated in ECN or F-RTO.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
> ChangeLog since v1:
>  - Add snd_cwnd_stamp timestamping in CWR mode
>
>  net/ipv4/tcp_input.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)

Acked-by: Neal Cardwell <ncardwell@google.com>

neal

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

* Re: [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr()
  2012-04-30 16:25 ` Neal Cardwell
@ 2012-04-30 17:45   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-04-30 17:45 UTC (permalink / raw)
  To: ncardwell; +Cc: ycheng, ilpo.jarvinen, nanditad, netdev

From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 30 Apr 2012 12:25:56 -0400

> On Mon, Apr 30, 2012 at 12:00 PM, Yuchung Cheng <ycheng@google.com> wrote:
>> When the cwnd reduction is done, ssthresh may be infinite
>> if TCP enters CWR via ECN or F-RTO. If cwnd is not undone, i.e.,
>> undo_marker is set, tcp_complete_cwr() falsely set cwnd to the
>> infinite ssthresh value. The correct operation is to keep cwnd
>> intact because it has been updated in ECN or F-RTO.
>>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> ---
>> ChangeLog since v1:
>>  - Add snd_cwnd_stamp timestamping in CWR mode
>>
>>  net/ipv4/tcp_input.c |    9 ++++++---
>>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> Acked-by: Neal Cardwell <ncardwell@google.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2012-04-30 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 16:00 [PATCH v2] tcp: fix infinite cwnd in tcp_complete_cwr() Yuchung Cheng
2012-04-30 16:25 ` Neal Cardwell
2012-04-30 17:45   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.