aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-03-14 02:00:44 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-03-14 02:00:44 +0000
commit1652b41032aa42691c544d9bdef26a4bda922fdd (patch)
treece0ac723126255dbe9f0c62cce2271fd16596e6a /package/kernel/mac80211
parent373c5e314fd20c7df8616e1e1c0b49a0b3577958 (diff)
downloadupstream-1652b41032aa42691c544d9bdef26a4bda922fdd.tar.gz
upstream-1652b41032aa42691c544d9bdef26a4bda922fdd.tar.bz2
upstream-1652b41032aa42691c544d9bdef26a4bda922fdd.zip
mac80211: fix a rounding issue in minstrel MCS rate duration calculation
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44749 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211')
-rw-r--r--package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch b/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch
new file mode 100644
index 0000000000..d13263655e
--- /dev/null
+++ b/package/kernel/mac80211/patches/308-mac80211-minstrel_ht-fix-rounding-issue-in-MCS-durat.patch
@@ -0,0 +1,43 @@
+From: Felix Fietkau <nbd@openwrt.org>
+Date: Fri, 13 Mar 2015 10:49:40 +0100
+Subject: [PATCH] mac80211: minstrel_ht: fix rounding issue in MCS duration
+ calculation
+
+On very high MCS bitrates, the calculated duration of rates that are
+next to each other can be very imprecise, due to the small packet size
+used as reference (1200 bytes).
+This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the
+same throughput when the probability is also the same. This leads to a
+bad rate selection for such rates.
+
+Fix this issue by introducing an average A-MPDU size factor into the
+calculation.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+---
+
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -17,10 +17,11 @@
+ #include "rc80211_minstrel.h"
+ #include "rc80211_minstrel_ht.h"
+
++#define AVG_AMPDU_SIZE 16
+ #define AVG_PKT_SIZE 1200
+
+ /* Number of bits for an average sized packet */
+-#define MCS_NBITS (AVG_PKT_SIZE << 3)
++#define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3)
+
+ /* Number of symbols for a packet with (bps) bits per symbol */
+ #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps))
+@@ -33,7 +34,8 @@
+ )
+
+ /* Transmit duration for the raw data part of an average sized packet */
+-#define MCS_DURATION(streams, sgi, bps) MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps)))
++#define MCS_DURATION(streams, sgi, bps) \
++ (MCS_SYMBOL_TIME(sgi, MCS_NSYMS((streams) * (bps))) / AVG_AMPDU_SIZE)
+
+ #define BW_20 0
+ #define BW_40 1