[PATCH] tcp: set congestion default through Kconfig

2006-09-18 Thread Stephen Hemminger
Bert's attempt was noble
It showed your desire for the truth
A simple path exists

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
---
 net/ipv4/Kconfig   |   39 +--
 net/ipv4/sysctl_net_ipv4.c |7 +++
 net/ipv4/tcp_cong.c|2 +-
 3 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 90f9136..e922c3a 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -573,12 +573,47 @@ config TCP_CONG_VENO
loss packets.
See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf
 
+choice
+   prompt "Default TCP congestion control"
+   default DEFAULT_BIC
+   help
+ Select the TCP congestion control that will be used by default
+ for all connections.
+
+   config DEFAULT_BIC
+   bool "Bic" if TCP_CONG_BIC=y
+
+   config DEFAULT_CUBIC
+   bool "Cubic" if TCP_CONG_CUBIC=y
+
+   config DEFAULT_HTCP
+   bool "Htcp" if TCP_CONG_HTCP=y
+
+   config DEFAULT_VEGAS
+   bool "Vegas" if TCP_CONG_VEGAS=y
+
+   config DEFAULT_WESTWOOD
+   bool "Westwood" if TCP_CONG_WESTWOOD=y
+
+   config DEFAULT_RENO
+   bool "Reno"
+
+endchoice
+
 endmenu
 
-config TCP_CONG_BIC
-   tristate
+config DEFAULT_BIC
depends on !TCP_CONG_ADVANCED
default y
 
+config DEFAULT_TCP_CONG
+   string
+   default "bic" if DEFAULT_BIC
+   default "cubic" if DEFAULT_CUBIC
+   default "htcp" if DEFAULT_HTCP
+   default "vegas" if DEFAULT_VEGAS
+   default "westwood" if DEFAULT_WESTWOOD
+   default "reno" if DEFAULT_RENO
+
 source "net/ipv4/ipvs/Kconfig"
 
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 19b2071..52b6481 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -129,6 +129,13 @@ static int sysctl_tcp_congestion_control
return ret;
 }
 
+static __init void tcp_congestion_default(void)
+{
+   tcp_set_default_congestion_control(CONFIG_DEFAULT_TCP_CONG)
+}
+
+late_initcall(tcp_congestion_default);
+
 
 ctl_table ipv4_table[] = {
 {
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 7ff2e42..af0aca1 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -48,7 +48,7 @@ int tcp_register_congestion_control(stru
printk(KERN_NOTICE "TCP %s already registered\n", ca->name);
ret = -EEXIST;
} else {
-   list_add_rcu(&ca->list, &tcp_cong_list);
+   list_add_tail_rcu(&ca->list, &tcp_cong_list);
printk(KERN_INFO "TCP %s registered\n", ca->name);
}
spin_unlock(&tcp_cong_list_lock);
-- 
1.4.1

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-18 Thread Ian McDonald

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
---
 net/ipv4/Kconfig   |   39 +--
 net/ipv4/sysctl_net_ipv4.c |7 +++
 net/ipv4/tcp_cong.c|2 +-
 3 files changed, 45 insertions(+), 3 deletions(-)


Nice solution.

Signed-off-by: Ian McDonald <[EMAIL PROTECTED]>
--
Ian McDonald
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group
Department of Computer Science
University of Waikato
New Zealand
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread Andi Kleen
On Tuesday 19 September 2006 06:41, Stephen Hemminger wrote:
> Bert's attempt was noble
> It showed your desire for the truth
> A simple path exists

I guess most people won't have a clue on what to configure here
(especially with such sparse help text, but even with more 
it would be hard). 

And you might end up with some weird error reports if someone
manages to configure one of the more broken algorithms.

How about a single auto selection heuristic: e.g. check the handshake latencies 
and if they are too long switch from reno to the newer one deemed most
stable?

-Andi
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread Hagen Paul Pfeifer
* Andi Kleen | 2006-09-19 12:03:51 [+0200]:

>How about a single auto selection heuristic: e.g. check the handshake 
>latencies 
>and if they are too long switch from reno to the newer one deemed most
>stable?

Thats absolute no practicable solution to discover the 'right' algorithm.
The latenzy is only one piece in the puzzle the determine the optimal
congestion control algorithm and completely inadequate. You must also discover
the bandwith and other factors to make a decision. And this is nearly
impossible and object of actual research.

Through due to the heterogeneity of the net it is often not possible the
select the right one. To select a "general purpose algorithm" here is the
better choice.

BTW: BIC is sometimes to aggressive in comparison to standard tcp behaviour
(e.g. in short RTT environments) - this is an known issue. Why not cubic as the
default one?

>-Andi

HGN



-- 
"You need the computing power of a Pentium, 16 MB RAM and 1 GB Harddisk
to run Win95. It took the computing power of 3 Commodore 64
to fly to the Moon. Something is wrong here, and it wasn't the Apollo."

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread Stephen Hemminger
On Tue, 19 Sep 2006 12:03:51 +0200
Andi Kleen <[EMAIL PROTECTED]> wrote:

> On Tuesday 19 September 2006 06:41, Stephen Hemminger wrote:
> > Bert's attempt was noble
> > It showed your desire for the truth
> > A simple path exists
> 
> I guess most people won't have a clue on what to configure here
> (especially with such sparse help text, but even with more 
> it would be hard). 
> 
> And you might end up with some weird error reports if someone
> manages to configure one of the more broken algorithms.
> 

I tried to only put known stable ones in the choices list.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread David Miller
From: Hagen Paul Pfeifer <[EMAIL PROTECTED]>
Date: Tue, 19 Sep 2006 14:35:35 +0200

> BTW: BIC is sometimes to aggressive in comparison to standard tcp
> behaviour (e.g. in short RTT environments) - this is an known
> issue. Why not cubic as the default one?

We may change over to CUBIC as the default in 2.6.19, I wanted
CUBIC to sit around in the tree for a while in case some major
issues came up first.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread Stephen Hemminger
On Tue, 19 Sep 2006 09:10:37 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: Hagen Paul Pfeifer <[EMAIL PROTECTED]>
> Date: Tue, 19 Sep 2006 14:35:35 +0200
> 
> > BTW: BIC is sometimes to aggressive in comparison to standard tcp
> > behaviour (e.g. in short RTT environments) - this is an known
> > issue. Why not cubic as the default one?
> 
> We may change over to CUBIC as the default in 2.6.19, I wanted
> CUBIC to sit around in the tree for a while in case some major
> issues came up first.

I was going to do this for 2.6.19 as well, but wanted more discussion
and also do it as a separate step from the config changes.

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread David Miller

Actually, I take that back:

net/ipv4/sysctl_net_ipv4.c: In function 
$,1rx(Btcp_congestion_default$,1ry(B:
net/ipv4/sysctl_net_ipv4.c:134: error: syntax error before $,1rx(B}$,1ry(B 
token
net/ipv4/sysctl_net_ipv4.c: At top level:
net/ipv4/sysctl_net_ipv4.c:136: warning: initialization from incompatible 
pointer type

I'll fix this up, but I'm seeing a very disturbing pattern lately
of very clueful people posting patches without typing "make".

Is this too much to ask these days?  This costs me an enormous
amount of time, to review someone's patch and verify it's logical
correctness, only to check it in and find out that it doesn't
even build.  That, frankly, is unacceptable.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Mon, 18 Sep 2006 21:41:04 -0700

> Bert's attempt was noble
> It showed your desire for the truth
> A simple path exists
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Looks good, applied.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread David Miller

Ok, I really give up, after adding the missing semicolon I now
get this:

net/ipv4/sysctl_net_ipv4.c:136: warning: initialization from incompatible 
pointer type

This is getting rediculious.

Folks, don't post patches which are not "request for comments"
explicitly in the subject line without testing the build, ever!

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig

2006-09-19 Thread Stephen Hemminger
It built (and ran) for me. But that was on a different machine.
Perhaps there was some git confusion, I'll go back to using quilt
it gives me less grief.

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] tcp: set congestion default through Kconfig (v2)

2006-09-19 Thread Stephen Hemminger
Bert's attempt was noble
It showed your desire for the truth
A simple path existed

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
---
 net/ipv4/Kconfig   |   39 +--
 net/ipv4/sysctl_net_ipv4.c |6 ++
 net/ipv4/tcp_cong.c|2 +-
 3 files changed, 44 insertions(+), 3 deletions(-)

--- net-2.6.19.orig/net/ipv4/Kconfig2006-09-19 13:11:09.0 -0700
+++ net-2.6.19/net/ipv4/Kconfig 2006-09-19 13:20:45.0 -0700
@@ -573,12 +573,47 @@
loss packets.
See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf
 
+choice
+   prompt "Default TCP congestion control"
+   default DEFAULT_BIC
+   help
+ Select the TCP congestion control that will be used by default
+ for all connections.
+
+   config DEFAULT_BIC
+   bool "Bic" if TCP_CONG_BIC=y
+
+   config DEFAULT_CUBIC
+   bool "Cubic" if TCP_CONG_CUBIC=y
+
+   config DEFAULT_HTCP
+   bool "Htcp" if TCP_CONG_HTCP=y
+
+   config DEFAULT_VEGAS
+   bool "Vegas" if TCP_CONG_VEGAS=y
+
+   config DEFAULT_WESTWOOD
+   bool "Westwood" if TCP_CONG_WESTWOOD=y
+
+   config DEFAULT_RENO
+   bool "Reno"
+
+endchoice
+
 endmenu
 
-config TCP_CONG_BIC
-   tristate
+config DEFAULT_BIC
depends on !TCP_CONG_ADVANCED
default y
 
+config DEFAULT_TCP_CONG
+   string
+   default "bic" if DEFAULT_BIC
+   default "cubic" if DEFAULT_CUBIC
+   default "htcp" if DEFAULT_HTCP
+   default "vegas" if DEFAULT_VEGAS
+   default "westwood" if DEFAULT_WESTWOOD
+   default "reno" if DEFAULT_RENO
+
 source "net/ipv4/ipvs/Kconfig"
 
--- net-2.6.19.orig/net/ipv4/sysctl_net_ipv4.c  2006-09-19 13:11:09.0 
-0700
+++ net-2.6.19/net/ipv4/sysctl_net_ipv4.c   2006-09-19 13:37:04.0 
-0700
@@ -129,6 +129,12 @@
return ret;
 }
 
+static int __init tcp_congestion_default(void)
+{
+   return tcp_set_default_congestion_control(CONFIG_DEFAULT_TCP_CONG);
+}
+
+late_initcall(tcp_congestion_default);
 
 ctl_table ipv4_table[] = {
 {
--- net-2.6.19.orig/net/ipv4/tcp_cong.c 2006-09-19 13:11:09.0 -0700
+++ net-2.6.19/net/ipv4/tcp_cong.c  2006-09-19 13:20:45.0 -0700
@@ -48,7 +48,7 @@
printk(KERN_NOTICE "TCP %s already registered\n", ca->name);
ret = -EEXIST;
} else {
-   list_add_rcu(&ca->list, &tcp_cong_list);
+   list_add_tail_rcu(&ca->list, &tcp_cong_list);
printk(KERN_INFO "TCP %s registered\n", ca->name);
}
spin_unlock(&tcp_cong_list_lock);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig (v2)

2006-09-19 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Tue, 19 Sep 2006 13:41:32 -0700

> Bert's attempt was noble
> It showed your desire for the truth
> A simple path existed
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Applied, but...

net/ipv4/Kconfig:607:warning: defaults for choice values not supported

Hmmm...
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] tcp: set congestion default through Kconfig (v2)

2006-09-19 Thread bert hubert
On Tue, Sep 19, 2006 at 02:20:07PM -0700, David Miller wrote:

> > Bert's attempt was noble
> > It showed your desire for the truth

It was also crap :-)

> Applied, but...
> net/ipv4/Kconfig:607:warning: defaults for choice values not supported

It does appear to do the right thing in all cases I throw against it, but
this warning is sure to generate noise.

It probably means CONFIG_BIC is both available in the menu, and set as a
separate option, and that this does not set the menu to CONFIG_BIC. This is
not a big deal however as the menu is not shown at all whenever line 607
applies.


-- 
http://www.PowerDNS.com  Open source, database driven DNS Software 
http://netherlabs.nl  Open and Closed source services
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html