Commit c21b39ac authored by Stefano Brivio's avatar Stefano Brivio Committed by David S. Miller

mac80211: make PID rate control algorithm the default

This makes the new PID TX rate control algorithm the default instead of the
rc80211_simple rate control algorithm. The simple algorithm was flawed in
several ways: it wasn't responsive at all and didn't age the information it was
relying on properly. The PID algorithm allows us to tune characteristics such
as responsiveness by adjusting parameters and was found to generally behave
better.

The default algorithm can be overridden to select simple instead. Which
ever algorithm is the default is included as part of the mac80211
module automatically. The other algorithm (simple vs. pid) can
be selected for inclusion as well. If EMBEDDED is selected then
the choice is available to have no default specified and neither
algorithm included in mac80211. The default algorithm can be set
through a modparam.

While at it, mark rc80211-simple as deprecated, and schedule it
for removal.
Signed-off-by: default avatarStefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b92edbe0
...@@ -314,3 +314,11 @@ Why: No in-kernel drivers will depend on it any longer. ...@@ -314,3 +314,11 @@ Why: No in-kernel drivers will depend on it any longer.
Who: John W. Linville <linville@tuxdriver.com> Who: John W. Linville <linville@tuxdriver.com>
--------------------------- ---------------------------
What: rc80211-simple rate control algorithm for mac80211
When: 2.6.26
Files: net/mac80211/rc80211-simple.c
Why: This algorithm was provided for reference but always exhibited bad
responsiveness and performance and has some serious flaws. It has been
replaced by rc80211-pid.
Who: Stefano Brivio <stefano.brivio@polimi.it>
...@@ -13,29 +13,75 @@ config MAC80211 ...@@ -13,29 +13,75 @@ config MAC80211
This option enables the hardware independent IEEE 802.11 This option enables the hardware independent IEEE 802.11
networking stack. networking stack.
config MAC80211_RCSIMPLE config MAC80211_RC_DEFAULT_CHOICE
bool "'simple' rate control algorithm" if EMBEDDED bool "Choose default rate control algorithm" if EMBEDDED
default y default y
depends on MAC80211 depends on MAC80211
help ---help---
This option allows you to turn off the 'simple' rate This options enables selection of a default rate control
control algorithm in mac80211. If you do turn it off, algorithm to be built into the mac80211 module. Alternate
you absolutely need another rate control algorithm. rate control algorithms might be built into the mac80211
module as well.
choice
prompt "Default rate control algorithm"
default MAC80211_RC_DEFAULT_PID
depends on MAC80211 && MAC80211_RC_DEFAULT_CHOICE
---help---
This option selects the default rate control algorithm
mac80211 will use. Note that this default can still be
overriden through the ieee80211_default_rc_algo module
parameter.
config MAC80211_RC_DEFAULT_PID
bool "PID controller based rate control algorithm"
select MAC80211_RC_PID
---help---
Select the PID controller based rate control as the
default rate control algorithm. You should choose
this unless you know what you are doing.
config MAC80211_RC_DEFAULT_SIMPLE
bool "Simple rate control algorithm"
select MAC80211_RC_SIMPLE
---help---
Select the simple rate control as the default rate
control algorithm. Note that this is a non-responsive,
dumb algorithm. You should choose the PID rate control
instead.
endchoice
Say Y unless you know you will have another algorithm config MAC80211_RC_DEFAULT
available. string
depends on MAC80211
default "pid" if MAC80211_RC_DEFAULT_PID
default "simple" if MAC80211_RC_DEFAULT_SIMPLE
default ""
config MAC80211_RCPID config MAC80211_RC_PID
bool "'PID' rate control algorithm" if EMBEDDED bool "PID controller based rate control algorithm"
default y default y
depends on MAC80211 depends on MAC80211
help ---help---
This option enables a TX rate control algorithm for This option enables a TX rate control algorithm for
mac80211 that uses a PID controller to select the TX mac80211 that uses a PID controller to select the TX
rate. rate.
Say Y unless you're sure you want to use a different Say Y or M unless you're sure you want to use a
rate control algorithm. different rate control algorithm.
config MAC80211_RC_SIMPLE
bool "Simple rate control algorithm (DEPRECATED)"
default n
depends on MAC80211
---help---
This option enables a very simple, non-responsive TX
rate control algorithm. This algorithm is deprecated
and will be removed from the kernel in near future.
It has been replaced by the PID algorithm.
Say N unless you know what you are doing.
config MAC80211_LEDS config MAC80211_LEDS
bool "Enable LED triggers" bool "Enable LED triggers"
......
...@@ -3,8 +3,8 @@ obj-$(CONFIG_MAC80211) += mac80211.o ...@@ -3,8 +3,8 @@ obj-$(CONFIG_MAC80211) += mac80211.o
mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
mac80211-objs-$(CONFIG_NET_SCHED) += wme.o mac80211-objs-$(CONFIG_NET_SCHED) += wme.o
mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o mac80211-objs-$(CONFIG_MAC80211_RC_SIMPLE) += rc80211_simple.o
mac80211-objs-$(CONFIG_MAC80211_RCPID) += rc80211_pid.o mac80211-objs-$(CONFIG_MAC80211_RC_PID) += rc80211_pid.o
mac80211-objs := \ mac80211-objs := \
ieee80211.o \ ieee80211.o \
......
...@@ -1312,13 +1312,13 @@ static int __init ieee80211_init(void) ...@@ -1312,13 +1312,13 @@ static int __init ieee80211_init(void)
BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb));
#ifdef CONFIG_MAC80211_RCSIMPLE #ifdef CONFIG_MAC80211_RC_SIMPLE
ret = ieee80211_rate_control_register(&mac80211_rcsimple); ret = ieee80211_rate_control_register(&mac80211_rcsimple);
if (ret) if (ret)
goto fail; goto fail;
#endif #endif
#ifdef CONFIG_MAC80211_RCPID #ifdef CONFIG_MAC80211_RC_PID
ret = ieee80211_rate_control_register(&mac80211_rcpid); ret = ieee80211_rate_control_register(&mac80211_rcpid);
if (ret) if (ret)
goto fail; goto fail;
...@@ -1338,10 +1338,10 @@ static int __init ieee80211_init(void) ...@@ -1338,10 +1338,10 @@ static int __init ieee80211_init(void)
fail: fail:
#ifdef CONFIG_MAC80211_RCSIMPLE #ifdef CONFIG_MAC80211_RC_SIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple); ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif #endif
#ifdef CONFIG_MAC80211_RCPID #ifdef CONFIG_MAC80211_RC_PID
ieee80211_rate_control_unregister(&mac80211_rcpid); ieee80211_rate_control_unregister(&mac80211_rcpid);
#endif #endif
...@@ -1350,10 +1350,10 @@ fail: ...@@ -1350,10 +1350,10 @@ fail:
static void __exit ieee80211_exit(void) static void __exit ieee80211_exit(void)
{ {
#ifdef CONFIG_MAC80211_RCSIMPLE #ifdef CONFIG_MAC80211_RC_SIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple); ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif #endif
#ifdef CONFIG_MAC80211_RCPID #ifdef CONFIG_MAC80211_RC_PID
ieee80211_rate_control_unregister(&mac80211_rcpid); ieee80211_rate_control_unregister(&mac80211_rcpid);
#endif #endif
......
...@@ -21,6 +21,11 @@ struct rate_control_alg { ...@@ -21,6 +21,11 @@ struct rate_control_alg {
static LIST_HEAD(rate_ctrl_algs); static LIST_HEAD(rate_ctrl_algs);
static DEFINE_MUTEX(rate_ctrl_mutex); static DEFINE_MUTEX(rate_ctrl_mutex);
static char *ieee80211_default_rc_algo = CONFIG_MAC80211_RC_DEFAULT;
module_param(ieee80211_default_rc_algo, charp, 0644);
MODULE_PARM_DESC(ieee80211_default_rc_algo,
"Default rate control algorithm for mac80211 to use");
int ieee80211_rate_control_register(struct rate_control_ops *ops) int ieee80211_rate_control_register(struct rate_control_ops *ops)
{ {
struct rate_control_alg *alg; struct rate_control_alg *alg;
...@@ -89,21 +94,27 @@ ieee80211_try_rate_control_ops_get(const char *name) ...@@ -89,21 +94,27 @@ ieee80211_try_rate_control_ops_get(const char *name)
return ops; return ops;
} }
/* Get the rate control algorithm. If `name' is NULL, get the first /* Get the rate control algorithm. */
* available algorithm. */
static struct rate_control_ops * static struct rate_control_ops *
ieee80211_rate_control_ops_get(const char *name) ieee80211_rate_control_ops_get(const char *name)
{ {
struct rate_control_ops *ops; struct rate_control_ops *ops;
const char *alg_name;
if (!name) if (!name)
name = "simple"; alg_name = ieee80211_default_rc_algo;
else
alg_name = name;
ops = ieee80211_try_rate_control_ops_get(name); ops = ieee80211_try_rate_control_ops_get(alg_name);
if (!ops) { if (!ops) {
request_module("rc80211_%s", name); request_module("rc80211_%s", alg_name);
ops = ieee80211_try_rate_control_ops_get(name); ops = ieee80211_try_rate_control_ops_get(alg_name);
} }
if (!ops && name)
/* try default if specific alg requested but not found */
ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo);
return ops; return ops;
} }
...@@ -244,3 +255,4 @@ void rate_control_deinitialize(struct ieee80211_local *local) ...@@ -244,3 +255,4 @@ void rate_control_deinitialize(struct ieee80211_local *local)
local->rate_ctrl = NULL; local->rate_ctrl = NULL;
rate_control_put(ref); rate_control_put(ref);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment