summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorThomas Huehn <thomas@net.t-labs.tu-berlin.de>2013-03-04 23:30:06 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 16:36:09 +0100
commitdb8c5ee6924cda3823fac83ee8c4115d1a8248c8 (patch)
tree3041ab2e837a66792dec17505e1741c5b7fb3127 /net
parentf744bf81f7501d03f45ba23f9cf947abc3b422c9 (diff)
downloadop-kernel-dev-db8c5ee6924cda3823fac83ee8c4115d1a8248c8.zip
op-kernel-dev-db8c5ee6924cda3823fac83ee8c4115d1a8248c8.tar.gz
mac80211: treat minstrel success probabilities below 10% as implausible
Based on minstrel_ht this patch treats success probabilities below 10% as implausible values for throughput calculation in minstrel's statistics. Current throughput per rate with such a low success probability is reset to 0 MBit/s. Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rc80211_minstrel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 5c0f532..f8d99a5 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -92,7 +92,6 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
mr->probability = minstrel_ewma(mr->probability,
mr->cur_prob,
EWMA_LEVEL);
- mr->cur_tp = mr->probability * (1000000 / usecs);
} else
mr->sample_skipped++;
@@ -101,6 +100,12 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
mr->success = 0;
mr->attempts = 0;
+ /* Update throughput per rate, reset thr. below 10% success */
+ if (mr->probability < MINSTREL_FRAC(10, 100))
+ mr->cur_tp = 0;
+ else
+ mr->cur_tp = mr->probability * (1000000 / usecs);
+
/* Sample less often below the 10% chance of success.
* Sample less often above the 95% chance of success. */
if (mr->probability > MINSTREL_FRAC(95, 100) ||
OpenPOWER on IntegriCloud