mac80211: refresh patches
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 342-mac80211-minstrel_ht-improve-sample-rate-selection.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 26 Dec 2020 19:12:22 +0100
3 Subject: [PATCH] mac80211: minstrel_ht: improve sample rate selection
4
5 Always allow sampling of rates faster than the primary max throughput rate.
6 When the second max_tp_rate is higher than the first one, sample attempts were
7 previously skipped, potentially causing rate control to get stuck at a slightly
8 lower rate
9
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/net/mac80211/rc80211_minstrel_ht.c
14 +++ b/net/mac80211/rc80211_minstrel_ht.c
15 @@ -1379,13 +1379,13 @@ minstrel_get_sample_rate(struct minstrel
16 mrs = &mg->rates[sample_idx];
17 sample_idx += sample_group * MCS_GROUP_RATES;
18
19 - /* Set tp_rate1, tp_rate2 to the highest / second highest max_tp_rate */
20 + tp_rate1 = mi->max_tp_rate[0];
21 +
22 + /* Set tp_rate2 to the second highest max_tp_rate */
23 if (minstrel_get_duration(mi->max_tp_rate[0]) >
24 minstrel_get_duration(mi->max_tp_rate[1])) {
25 - tp_rate1 = mi->max_tp_rate[1];
26 tp_rate2 = mi->max_tp_rate[0];
27 } else {
28 - tp_rate1 = mi->max_tp_rate[0];
29 tp_rate2 = mi->max_tp_rate[1];
30 }
31