[TCP]: default congestion control menu

Change how default TCP congestion control is chosen. Don't just use
last installed module, instead allow selection during configuration,
and make sure and use the default regardless of load order.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Stephen Hemminger 2006-09-24 20:11:58 -07:00 committed by David S. Miller
parent 5b7c714ec2
commit 3d2573f7eb
3 changed files with 47 additions and 6 deletions

View file

@ -448,7 +448,7 @@ config INET_TCP_DIAG
depends on INET_DIAG depends on INET_DIAG
def_tristate INET_DIAG def_tristate INET_DIAG
config TCP_CONG_ADVANCED menuconfig TCP_CONG_ADVANCED
bool "TCP: advanced congestion control" bool "TCP: advanced congestion control"
---help--- ---help---
Support for selection of various TCP congestion control Support for selection of various TCP congestion control
@ -459,9 +459,7 @@ config TCP_CONG_ADVANCED
If unsure, say N. If unsure, say N.
# TCP Reno is builtin (required as fallback) if TCP_CONG_ADVANCED
menu "TCP congestion control"
depends on TCP_CONG_ADVANCED
config TCP_CONG_BIC config TCP_CONG_BIC
tristate "Binary Increase Congestion (BIC) control" tristate "Binary Increase Congestion (BIC) control"
@ -574,12 +572,49 @@ config TCP_CONG_VENO
loss packets. loss packets.
See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf See http://www.ntu.edu.sg/home5/ZHOU0022/papers/CPFu03a.pdf
endmenu 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
endif
config TCP_CONG_BIC config TCP_CONG_BIC
tristate tristate
depends on !TCP_CONG_ADVANCED depends on !TCP_CONG_ADVANCED
default y 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
default "bic"
source "net/ipv4/ipvs/Kconfig" source "net/ipv4/ipvs/Kconfig"

View file

@ -129,6 +129,12 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
return ret; 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[] = { ctl_table ipv4_table[] = {
{ {

View file

@ -48,7 +48,7 @@ int tcp_register_congestion_control(struct tcp_congestion_ops *ca)
printk(KERN_NOTICE "TCP %s already registered\n", ca->name); printk(KERN_NOTICE "TCP %s already registered\n", ca->name);
ret = -EEXIST; ret = -EEXIST;
} else { } 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); printk(KERN_INFO "TCP %s registered\n", ca->name);
} }
spin_unlock(&tcp_cong_list_lock); spin_unlock(&tcp_cong_list_lock);