Commit 019c6fc2 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg

mac80211: minstrel_ht: improve sample rate selection

Always allow sampling of rates faster than the primary max throughput rate.
When the second max_tp_rate is higher than the first one, sample attempts were
previously skipped, potentially causing rate control to get stuck at a slightly
lower rate
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210115120242.89616-7-nbd@nbd.nameSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1ae8bba9
...@@ -1379,13 +1379,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ...@@ -1379,13 +1379,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
mrs = &mg->rates[sample_idx]; mrs = &mg->rates[sample_idx];
sample_idx += sample_group * MCS_GROUP_RATES; sample_idx += sample_group * MCS_GROUP_RATES;
/* Set tp_rate1, tp_rate2 to the highest / second highest max_tp_rate */ tp_rate1 = mi->max_tp_rate[0];
/* Set tp_rate2 to the second highest max_tp_rate */
if (minstrel_get_duration(mi->max_tp_rate[0]) > if (minstrel_get_duration(mi->max_tp_rate[0]) >
minstrel_get_duration(mi->max_tp_rate[1])) { minstrel_get_duration(mi->max_tp_rate[1])) {
tp_rate1 = mi->max_tp_rate[1];
tp_rate2 = mi->max_tp_rate[0]; tp_rate2 = mi->max_tp_rate[0];
} else { } else {
tp_rate1 = mi->max_tp_rate[0];
tp_rate2 = mi->max_tp_rate[1]; tp_rate2 = mi->max_tp_rate[1];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment