Skip to content

Commit f4ec7cb

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: minstrel: do not sample rates 3 times slower than max_prob_rate
These rates are highly unlikely to be used quickly, even if the link deteriorates rapidly. This improves throughput in cases where CCK rates are not reliable enough to be skipped entirely during sampling. Sampling these rates regularly can cost a lot of airtime. Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 972b66b commit f4ec7cb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/mac80211/rc80211_minstrel_ht.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
10041004
return -1;
10051005

10061006
/*
1007-
* Do not sample if the probability is already higher than 95%
1008-
* to avoid wasting airtime.
1007+
* Do not sample if the probability is already higher than 95%,
1008+
* or if the rate is 3 times slower than the current max probability
1009+
* rate, to avoid wasting airtime.
10091010
*/
1010-
if (mrs->prob_ewma > MINSTREL_FRAC(95, 100))
1011+
sample_dur = minstrel_get_duration(sample_idx);
1012+
if (mrs->prob_ewma > MINSTREL_FRAC(95, 100) ||
1013+
minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur)
10111014
return -1;
10121015

10131016
/*
@@ -1017,7 +1020,6 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
10171020

10181021
cur_max_tp_streams = minstrel_mcs_groups[tp_rate1 /
10191022
MCS_GROUP_RATES].streams;
1020-
sample_dur = minstrel_get_duration(sample_idx);
10211023
if (sample_dur >= minstrel_get_duration(tp_rate2) &&
10221024
(cur_max_tp_streams - 1 <
10231025
minstrel_mcs_groups[sample_group].streams ||

0 commit comments

Comments
 (0)