提交 d66c2582 编写于 作者: F Felix Fietkau 提交者: Johannes Berg

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: NFelix Fietkau <nbd@openwrt.org>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 2e54a689
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
#include "rc80211_minstrel.h" #include "rc80211_minstrel.h"
#include "rc80211_minstrel_ht.h" #include "rc80211_minstrel_ht.h"
#define AVG_AMPDU_SIZE 16
#define AVG_PKT_SIZE 1200 #define AVG_PKT_SIZE 1200
/* Number of bits for an average sized packet */ /* 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 */ /* Number of symbols for a packet with (bps) bits per symbol */
#define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps)) #define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps))
...@@ -33,7 +34,8 @@ ...@@ -33,7 +34,8 @@
) )
/* Transmit duration for the raw data part of an average sized packet */ /* 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_20 0
#define BW_40 1 #define BW_40 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册