diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-03-16 20:00:25 +0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-18 23:11:58 +0400 |
commit | 3e8b1eb21c8b9806928000bf733e5762a64a7f72 (patch) | |
tree | 21ee0367d0a9d86b164b3bfb57c994cb894f3dbc /net | |
parent | d260ff12e7768444b4da7612b785cfd7cbc1d1c1 (diff) | |
download | linux-3e8b1eb21c8b9806928000bf733e5762a64a7f72.tar.xz |
mac80211/minstrel_ht: improve rate selection stability
Under load, otherwise stable rates can easily fluctuate because of
collisions. In my tests on a clean channel, the success probability of
the max throughput rate often stays somewhere between 90% and 100% under
load. This can cause some unnecessary switching to lower rates.
This patch improves stability by treating success probability values
between 90% and 100% the same.
In my tests on a 3x3 HT20 link with lots of TCP traffic, it improves the
average throughput by a few mbit/s.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 749552bdcfe1..90499c421702 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -202,14 +202,23 @@ minstrel_ht_calc_tp(struct minstrel_ht_sta *mi, int group, int rate) struct minstrel_rate_stats *mr; unsigned int nsecs = 0; unsigned int tp; + unsigned int prob; mr = &mi->groups[group].rates[rate]; + prob = mr->probability; - if (mr->probability < MINSTREL_FRAC(1, 10)) { + if (prob < MINSTREL_FRAC(1, 10)) { mr->cur_tp = 0; return; } + /* + * For the throughput calculation, limit the probability value to 90% to + * account for collision related packet error rate fluctuation + */ + if (prob > MINSTREL_FRAC(9, 10)) + prob = MINSTREL_FRAC(9, 10); + if (group != MINSTREL_CCK_GROUP) nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len); |