diff options
author | Stefano Brivio <stefano.brivio@polimi.it> | 2007-12-18 19:26:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:41 -0500 |
commit | c21b39aca4f8f4975784e54cd3a1b80bab80dcc0 (patch) | |
tree | bcf9b8ab5ecdb77fbd7ff7e56bc6474334a5d008 | |
parent | b92edbe0b8a36a833c16b0cbafb6e899b81ffc08 (diff) |
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: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 8 | ||||
-rw-r--r-- | net/mac80211/Kconfig | 72 | ||||
-rw-r--r-- | net/mac80211/Makefile | 4 | ||||
-rw-r--r-- | net/mac80211/ieee80211.c | 12 | ||||
-rw-r--r-- | net/mac80211/ieee80211_rate.c | 24 |
5 files changed, 93 insertions, 27 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 0927425026f1..a6cf8f6fc586 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -314,3 +314,11 @@ Why: No in-kernel drivers will depend on it any longer. | |||
314 | Who: John W. Linville <linville@tuxdriver.com> | 314 | Who: John W. Linville <linville@tuxdriver.com> |
315 | 315 | ||
316 | --------------------------- | 316 | --------------------------- |
317 | |||
318 | What: rc80211-simple rate control algorithm for mac80211 | ||
319 | When: 2.6.26 | ||
320 | Files: net/mac80211/rc80211-simple.c | ||
321 | Why: This algorithm was provided for reference but always exhibited bad | ||
322 | responsiveness and performance and has some serious flaws. It has been | ||
323 | replaced by rc80211-pid. | ||
324 | Who: Stefano Brivio <stefano.brivio@polimi.it> | ||
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 9f8663b412d9..297f4d967e2d 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -13,29 +13,75 @@ config MAC80211 | |||
13 | This option enables the hardware independent IEEE 802.11 | 13 | This option enables the hardware independent IEEE 802.11 |
14 | networking stack. | 14 | networking stack. |
15 | 15 | ||
16 | config MAC80211_RCSIMPLE | 16 | config MAC80211_RC_DEFAULT_CHOICE |
17 | bool "'simple' rate control algorithm" if EMBEDDED | 17 | bool "Choose default rate control algorithm" if EMBEDDED |
18 | default y | 18 | default y |
19 | depends on MAC80211 | 19 | depends on MAC80211 |
20 | help | 20 | ---help--- |
21 | This option allows you to turn off the 'simple' rate | 21 | This options enables selection of a default rate control |
22 | control algorithm in mac80211. If you do turn it off, | 22 | algorithm to be built into the mac80211 module. Alternate |
23 | you absolutely need another rate control algorithm. | 23 | rate control algorithms might be built into the mac80211 |
24 | module as well. | ||
25 | |||
26 | choice | ||
27 | prompt "Default rate control algorithm" | ||
28 | default MAC80211_RC_DEFAULT_PID | ||
29 | depends on MAC80211 && MAC80211_RC_DEFAULT_CHOICE | ||
30 | ---help--- | ||
31 | This option selects the default rate control algorithm | ||
32 | mac80211 will use. Note that this default can still be | ||
33 | overriden through the ieee80211_default_rc_algo module | ||
34 | parameter. | ||
35 | |||
36 | config MAC80211_RC_DEFAULT_PID | ||
37 | bool "PID controller based rate control algorithm" | ||
38 | select MAC80211_RC_PID | ||
39 | ---help--- | ||
40 | Select the PID controller based rate control as the | ||
41 | default rate control algorithm. You should choose | ||
42 | this unless you know what you are doing. | ||
43 | |||
44 | config MAC80211_RC_DEFAULT_SIMPLE | ||
45 | bool "Simple rate control algorithm" | ||
46 | select MAC80211_RC_SIMPLE | ||
47 | ---help--- | ||
48 | Select the simple rate control as the default rate | ||
49 | control algorithm. Note that this is a non-responsive, | ||
50 | dumb algorithm. You should choose the PID rate control | ||
51 | instead. | ||
52 | |||
53 | endchoice | ||
24 | 54 | ||
25 | Say Y unless you know you will have another algorithm | 55 | config MAC80211_RC_DEFAULT |
26 | available. | 56 | string |
57 | depends on MAC80211 | ||
58 | default "pid" if MAC80211_RC_DEFAULT_PID | ||
59 | default "simple" if MAC80211_RC_DEFAULT_SIMPLE | ||
60 | default "" | ||
27 | 61 | ||
28 | config MAC80211_RCPID | 62 | config MAC80211_RC_PID |
29 | bool "'PID' rate control algorithm" if EMBEDDED | 63 | bool "PID controller based rate control algorithm" |
30 | default y | 64 | default y |
31 | depends on MAC80211 | 65 | depends on MAC80211 |
32 | help | 66 | ---help--- |
33 | This option enables a TX rate control algorithm for | 67 | This option enables a TX rate control algorithm for |
34 | mac80211 that uses a PID controller to select the TX | 68 | mac80211 that uses a PID controller to select the TX |
35 | rate. | 69 | rate. |
36 | 70 | ||
37 | Say Y unless you're sure you want to use a different | 71 | Say Y or M unless you're sure you want to use a |
38 | rate control algorithm. | 72 | different rate control algorithm. |
73 | |||
74 | config MAC80211_RC_SIMPLE | ||
75 | bool "Simple rate control algorithm (DEPRECATED)" | ||
76 | default n | ||
77 | depends on MAC80211 | ||
78 | ---help--- | ||
79 | This option enables a very simple, non-responsive TX | ||
80 | rate control algorithm. This algorithm is deprecated | ||
81 | and will be removed from the kernel in near future. | ||
82 | It has been replaced by the PID algorithm. | ||
83 | |||
84 | Say N unless you know what you are doing. | ||
39 | 85 | ||
40 | config MAC80211_LEDS | 86 | config MAC80211_LEDS |
41 | bool "Enable LED triggers" | 87 | bool "Enable LED triggers" |
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile index 62c01ca099e5..a375f0477da0 100644 --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile | |||
@@ -3,8 +3,8 @@ obj-$(CONFIG_MAC80211) += mac80211.o | |||
3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o | 3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o |
4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o | 4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o |
5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o | 5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o |
6 | mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o | 6 | mac80211-objs-$(CONFIG_MAC80211_RC_SIMPLE) += rc80211_simple.o |
7 | mac80211-objs-$(CONFIG_MAC80211_RCPID) += rc80211_pid.o | 7 | mac80211-objs-$(CONFIG_MAC80211_RC_PID) += rc80211_pid.o |
8 | 8 | ||
9 | mac80211-objs := \ | 9 | mac80211-objs := \ |
10 | ieee80211.o \ | 10 | ieee80211.o \ |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 3d7b4341914e..c0dbf77547f7 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -1312,13 +1312,13 @@ static int __init ieee80211_init(void) | |||
1312 | 1312 | ||
1313 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); | 1313 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); |
1314 | 1314 | ||
1315 | #ifdef CONFIG_MAC80211_RCSIMPLE | 1315 | #ifdef CONFIG_MAC80211_RC_SIMPLE |
1316 | ret = ieee80211_rate_control_register(&mac80211_rcsimple); | 1316 | ret = ieee80211_rate_control_register(&mac80211_rcsimple); |
1317 | if (ret) | 1317 | if (ret) |
1318 | goto fail; | 1318 | goto fail; |
1319 | #endif | 1319 | #endif |
1320 | 1320 | ||
1321 | #ifdef CONFIG_MAC80211_RCPID | 1321 | #ifdef CONFIG_MAC80211_RC_PID |
1322 | ret = ieee80211_rate_control_register(&mac80211_rcpid); | 1322 | ret = ieee80211_rate_control_register(&mac80211_rcpid); |
1323 | if (ret) | 1323 | if (ret) |
1324 | goto fail; | 1324 | goto fail; |
@@ -1338,10 +1338,10 @@ static int __init ieee80211_init(void) | |||
1338 | 1338 | ||
1339 | fail: | 1339 | fail: |
1340 | 1340 | ||
1341 | #ifdef CONFIG_MAC80211_RCSIMPLE | 1341 | #ifdef CONFIG_MAC80211_RC_SIMPLE |
1342 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | 1342 | ieee80211_rate_control_unregister(&mac80211_rcsimple); |
1343 | #endif | 1343 | #endif |
1344 | #ifdef CONFIG_MAC80211_RCPID | 1344 | #ifdef CONFIG_MAC80211_RC_PID |
1345 | ieee80211_rate_control_unregister(&mac80211_rcpid); | 1345 | ieee80211_rate_control_unregister(&mac80211_rcpid); |
1346 | #endif | 1346 | #endif |
1347 | 1347 | ||
@@ -1350,10 +1350,10 @@ fail: | |||
1350 | 1350 | ||
1351 | static void __exit ieee80211_exit(void) | 1351 | static void __exit ieee80211_exit(void) |
1352 | { | 1352 | { |
1353 | #ifdef CONFIG_MAC80211_RCSIMPLE | 1353 | #ifdef CONFIG_MAC80211_RC_SIMPLE |
1354 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | 1354 | ieee80211_rate_control_unregister(&mac80211_rcsimple); |
1355 | #endif | 1355 | #endif |
1356 | #ifdef CONFIG_MAC80211_RCPID | 1356 | #ifdef CONFIG_MAC80211_RC_PID |
1357 | ieee80211_rate_control_unregister(&mac80211_rcpid); | 1357 | ieee80211_rate_control_unregister(&mac80211_rcpid); |
1358 | #endif | 1358 | #endif |
1359 | 1359 | ||
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index e495b0998b4d..65fc9ad615e9 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
@@ -21,6 +21,11 @@ struct rate_control_alg { | |||
21 | static LIST_HEAD(rate_ctrl_algs); | 21 | static LIST_HEAD(rate_ctrl_algs); |
22 | static DEFINE_MUTEX(rate_ctrl_mutex); | 22 | static DEFINE_MUTEX(rate_ctrl_mutex); |
23 | 23 | ||
24 | static char *ieee80211_default_rc_algo = CONFIG_MAC80211_RC_DEFAULT; | ||
25 | module_param(ieee80211_default_rc_algo, charp, 0644); | ||
26 | MODULE_PARM_DESC(ieee80211_default_rc_algo, | ||
27 | "Default rate control algorithm for mac80211 to use"); | ||
28 | |||
24 | int ieee80211_rate_control_register(struct rate_control_ops *ops) | 29 | int ieee80211_rate_control_register(struct rate_control_ops *ops) |
25 | { | 30 | { |
26 | struct rate_control_alg *alg; | 31 | struct rate_control_alg *alg; |
@@ -89,21 +94,27 @@ ieee80211_try_rate_control_ops_get(const char *name) | |||
89 | return ops; | 94 | return ops; |
90 | } | 95 | } |
91 | 96 | ||
92 | /* Get the rate control algorithm. If `name' is NULL, get the first | 97 | /* Get the rate control algorithm. */ |
93 | * available algorithm. */ | ||
94 | static struct rate_control_ops * | 98 | static struct rate_control_ops * |
95 | ieee80211_rate_control_ops_get(const char *name) | 99 | ieee80211_rate_control_ops_get(const char *name) |
96 | { | 100 | { |
97 | struct rate_control_ops *ops; | 101 | struct rate_control_ops *ops; |
102 | const char *alg_name; | ||
98 | 103 | ||
99 | if (!name) | 104 | if (!name) |
100 | name = "simple"; | 105 | alg_name = ieee80211_default_rc_algo; |
106 | else | ||
107 | alg_name = name; | ||
101 | 108 | ||
102 | ops = ieee80211_try_rate_control_ops_get(name); | 109 | ops = ieee80211_try_rate_control_ops_get(alg_name); |
103 | if (!ops) { | 110 | if (!ops) { |
104 | request_module("rc80211_%s", name); | 111 | request_module("rc80211_%s", alg_name); |
105 | ops = ieee80211_try_rate_control_ops_get(name); | 112 | ops = ieee80211_try_rate_control_ops_get(alg_name); |
106 | } | 113 | } |
114 | if (!ops && name) | ||
115 | /* try default if specific alg requested but not found */ | ||
116 | ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo); | ||
117 | |||
107 | return ops; | 118 | return ops; |
108 | } | 119 | } |
109 | 120 | ||
@@ -244,3 +255,4 @@ void rate_control_deinitialize(struct ieee80211_local *local) | |||
244 | local->rate_ctrl = NULL; | 255 | local->rate_ctrl = NULL; |
245 | rate_control_put(ref); | 256 | rate_control_put(ref); |
246 | } | 257 | } |
258 | |||