Skip to content

Commit

Permalink
mac80211: minstrel_ht: reduce unnecessary rate probing attempts
Browse files Browse the repository at this point in the history
On hardware with static fallback tables (e.g. mt76x2), rate probing attempts
can be very expensive.
On such devices, avoid sampling rates slower than the per-group max throughput
rate, based on the assumption that the fallback table will take care of probing
lower rates within that group if the higher rates fail.

To further reduce unnecessary probing attempts, skip duplicate attempts on
rates slower than the max throughput rate.

Signed-off-by: Felix Fietkau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
nbd168 authored and jmberg-intel committed Aug 21, 2019
1 parent 56dd918 commit f793c7e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions net/mac80211/rc80211_minstrel_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,21 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur)
return -1;


/*
* For devices with no configurable multi-rate retry, skip sampling
* below the per-group max throughput rate, and only use one sampling
* attempt per rate
*/
if (mp->hw->max_rates == 1 &&
(minstrel_get_duration(mg->max_group_tp_rate[0]) < sample_dur ||
mrs->attempts))
return -1;

/* Skip already sampled slow rates */
if (sample_dur >= minstrel_get_duration(tp_rate1) && mrs->attempts)
return -1;

/*
* Make sure that lower rates get sampled only occasionally,
* if the link is working perfectly.
Expand Down

0 comments on commit f793c7e

Please sign in to comment.