netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
To: David Miller <davem@davemloft.net>
Cc: opurdila@ixiacom.com, Netdev <netdev@vger.kernel.org>
Subject: Re: initial congestion window for connections in the listen queue
Date: Tue, 14 Apr 2009 11:37:08 +0300 (EEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0904141118260.10088@wrl-59.cs.helsinki.fi> (raw)
In-Reply-To: <20090413.145829.97306950.davem@davemloft.net>

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

On Mon, 13 Apr 2009, David Miller wrote:

> From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
> Date: Tue, 14 Apr 2009 00:54:40 +0300 (EEST)
> 
> > A long-standing feature in tcp_init_metrics() is such that any of its goto 
> > reset prevents call to tcp_init_cwnd(). I never remembered to fix that.
> 
> Grumble, we definitely need to fix that!
> 
> I suspect I added that problem, because tcp_init_metrics() at one
> point couldn't cope with a NULL dst.

I suppose you meant tcp_init_cwnd() here, otherwise this doesn't make much 
sense to me?

> But that is no longer the
> case so I'm pretty sure we can unconditionally go:
> 
> 	tp->snd_cwnd = tcp_init_cwnd(tp, dst);
> 	tp->snd_cwnd_stamp = tcp_time_stamp;
> 
> in the 'reset' path too, right?

At least it compiles... :-) ...I don't see any problems either.

> But note thata even if this reset path is taken, we should still have
> at least the default ->snd_cwnd value of 2.

Right, it wasn't be uninitialized as we get that 2 from elsewhere.

A patch below.

-- 
[PATCH] tcp: fix >2 iw selection

A long-standing feature in tcp_init_metrics() is such that
any of its goto reset prevents call to tcp_init_cwnd().

Compile tested.

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

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4872524..00ba37b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -928,6 +928,8 @@ static void tcp_init_metrics(struct sock *sk)
 	tcp_set_rto(sk);
 	if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)
 		goto reset;
+
+cwnd:
 	tp->snd_cwnd = tcp_init_cwnd(tp, dst);
 	tp->snd_cwnd_stamp = tcp_time_stamp;
 	return;
@@ -942,6 +944,7 @@ reset:
 		tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT;
 		inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT;
 	}
+	goto cwnd;
 }
 
 static void tcp_update_reordering(struct sock *sk, const int metric,
-- 
1.5.2.2

  reply	other threads:[~2009-04-14  8:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 20:46 initial congestion window for connections in the listen queue Octavian Purdila
2009-04-13 21:26 ` David Miller
2009-04-13 21:54   ` Ilpo Järvinen
2009-04-13 21:58     ` David Miller
2009-04-14  8:37       ` Ilpo Järvinen [this message]
2009-04-14  9:09         ` David Miller
2009-04-14 13:48         ` Octavian Purdila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0904141118260.10088@wrl-59.cs.helsinki.fi \
    --to=ilpo.jarvinen@helsinki.fi \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=opurdila@ixiacom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).