aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-09-28 15:57:58 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-10-30 11:17:40 +0100
commitc51a39d4a5a7bc1e7008c12b79b9236f667ce5ef (patch)
tree0539731aa878b8f8f51ff2f1e10bfbcc55f18f03 /package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch
parent8cf67728d3b41c47ee5e322bb8c2908696380f24 (diff)
downloadupstream-c51a39d4a5a7bc1e7008c12b79b9236f667ce5ef.tar.gz
upstream-c51a39d4a5a7bc1e7008c12b79b9236f667ce5ef.tar.bz2
upstream-c51a39d4a5a7bc1e7008c12b79b9236f667ce5ef.zip
mac80211: add an improved moving average algorithm to minstrel
Improves rate control responsiveness and performance Signed-off-by: Felix Fietkau <nbd@nbd.name> [reworked to apply on 4.19.79 mac80211 + renumbered + refreshed] Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch b/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch
new file mode 100644
index 0000000000..d38d33b41e
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/362-mac80211-minstrel-remove-divisions-in-tx-status-path.patch
@@ -0,0 +1,61 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Sat, 28 Sep 2019 15:44:06 +0200
+Subject: [PATCH] mac80211: minstrel: remove divisions in tx status path
+
+Use a slightly different threshold for downgrading spatial streams to
+make it easier to calculate without divisions.
+Slightly reduces CPU overhead.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/net/mac80211/rc80211_minstrel.c
++++ b/net/mac80211/rc80211_minstrel.c
+@@ -295,8 +295,7 @@ minstrel_tx_status(void *priv, struct ie
+ if (mi->sample_deferred > 0)
+ mi->sample_deferred--;
+
+- if (time_after(jiffies, mi->last_stats_update +
+- (mp->update_interval * HZ) / 1000))
++ if (time_after(jiffies, mi->last_stats_update + mp->update_interval))
+ minstrel_update_stats(mp, mi);
+ }
+
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -937,23 +937,21 @@ minstrel_ht_tx_status(void *priv, struct
+ */
+ rate = minstrel_get_ratestats(mi, mi->max_tp_rate[0]);
+ if (rate->attempts > 30 &&
+- MINSTREL_FRAC(rate->success, rate->attempts) <
+- MINSTREL_FRAC(20, 100)) {
++ rate->success < rate->attempts / 4) {
+ minstrel_downgrade_rate(mi, &mi->max_tp_rate[0], true);
+ update = true;
+ }
+
+ rate2 = minstrel_get_ratestats(mi, mi->max_tp_rate[1]);
+ if (rate2->attempts > 30 &&
+- MINSTREL_FRAC(rate2->success, rate2->attempts) <
+- MINSTREL_FRAC(20, 100)) {
++ rate2->success < rate2->attempts / 4) {
+ minstrel_downgrade_rate(mi, &mi->max_tp_rate[1], false);
+ update = true;
+ }
+ }
+
+ if (time_after(jiffies, mi->last_stats_update +
+- (mp->update_interval / 2 * HZ) / 1000)) {
++ mp->update_interval / 2)) {
+ update = true;
+ minstrel_ht_update_stats(mp, mi, true);
+ }
+@@ -1640,7 +1638,7 @@ minstrel_ht_alloc(struct ieee80211_hw *h
+ mp->has_mrr = true;
+
+ mp->hw = hw;
+- mp->update_interval = 100;
++ mp->update_interval = HZ / 10;
+
+ #ifdef CPTCFG_MAC80211_DEBUGFS
+ mp->fixed_rate_idx = (u32) -1;