aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-02-07 14:30:01 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-02-07 14:30:01 +0000
commitf67cdec344c847b3451e66dcff12555975f49953 (patch)
treef67a974218fb18b48f7116840e09f3c249aad108 /package/kernel/mac80211
parentb8cded5c4a358b6eb4f4898b3fdd5721300e3c51 (diff)
downloadmaster-187ad058-f67cdec344c847b3451e66dcff12555975f49953.tar.gz
master-187ad058-f67cdec344c847b3451e66dcff12555975f49953.tar.bz2
master-187ad058-f67cdec344c847b3451e66dcff12555975f49953.zip
mac80211: merge a fix for minstrel expected throughput reporting
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48648 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211')
-rw-r--r--package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch b/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch
new file mode 100644
index 0000000000..4dc6d663ed
--- /dev/null
+++ b/package/kernel/mac80211/patches/330-mac80211-minstrel-Change-expected-throughput-unit-ba.patch
@@ -0,0 +1,51 @@
+From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
+Date: Tue, 2 Feb 2016 08:12:26 +0100
+Subject: [PATCH] mac80211: minstrel: Change expected throughput unit back to
+ Kbps
+
+The change from cur_tp to the function
+minstrel_get_tp_avg/minstrel_ht_get_tp_avg changed the unit used for the
+current throughput. For example in minstrel_ht the correct
+conversion between them would be:
+
+ mrs->cur_tp / 10 == minstrel_ht_get_tp_avg(..).
+
+This factor 10 must also be included in the calculation of
+minstrel_get_expected_throughput and minstrel_ht_get_expected_throughput to
+return values with the unit [Kbps] instead of [10Kbps]. Otherwise routing
+algorithms like B.A.T.M.A.N. V will make incorrect decision based on these
+values. Its kernel based implementation expects expected_throughput always
+to have the unit [Kbps] and not sometimes [10Kbps] and sometimes [Kbps].
+
+The same requirement has iw or olsrdv2's nl80211 based statistics module
+which retrieve the same data via NL80211_STA_INFO_TX_BITRATE.
+
+Cc: stable@vger.kernel.org
+Fixes: 6a27b2c40b48 ("mac80211: restructure per-rate throughput calculation into function")
+Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+
+--- a/net/mac80211/rc80211_minstrel.c
++++ b/net/mac80211/rc80211_minstrel.c
+@@ -711,7 +711,7 @@ static u32 minstrel_get_expected_through
+ * computing cur_tp
+ */
+ tmp_mrs = &mi->r[idx].stats;
+- tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma);
++ tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma) * 10;
+ tmp_cur_tp = tmp_cur_tp * 1200 * 8 / 1024;
+
+ return tmp_cur_tp;
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1335,7 +1335,8 @@ static u32 minstrel_ht_get_expected_thro
+ prob = mi->groups[i].rates[j].prob_ewma;
+
+ /* convert tp_avg from pkt per second in kbps */
+- tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * AVG_PKT_SIZE * 8 / 1024;
++ tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * 10;
++ tp_avg = tp_avg * AVG_PKT_SIZE * 8 / 1024;
+
+ return tp_avg;
+ }