Commit eeafcb0c authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg

mac80211: minstrel_ht: remove old ewma based rate average code

The new noise filter has been the default for a while now with no reported
downside and significant improvement compared to the old code.
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210115120242.89616-5-nbd@nbd.nameSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent cbda98c7
...@@ -769,17 +769,8 @@ minstrel_ht_calc_rate_stats(struct minstrel_priv *mp, ...@@ -769,17 +769,8 @@ minstrel_ht_calc_rate_stats(struct minstrel_priv *mp,
if (unlikely(mrs->attempts > 0)) { if (unlikely(mrs->attempts > 0)) {
mrs->sample_skipped = 0; mrs->sample_skipped = 0;
cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts);
if (mp->new_avg) {
minstrel_filter_avg_add(&mrs->prob_avg, minstrel_filter_avg_add(&mrs->prob_avg,
&mrs->prob_avg_1, cur_prob); &mrs->prob_avg_1, cur_prob);
} else if (unlikely(!mrs->att_hist)) {
mrs->prob_avg = cur_prob;
} else {
/*update exponential weighted moving avarage */
mrs->prob_avg = minstrel_ewma(mrs->prob_avg,
cur_prob,
EWMA_LEVEL);
}
mrs->att_hist += mrs->attempts; mrs->att_hist += mrs->attempts;
mrs->succ_hist += mrs->success; mrs->succ_hist += mrs->success;
} else { } else {
...@@ -913,10 +904,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, ...@@ -913,10 +904,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
/* Try to increase robustness of max_prob_rate*/ /* Try to increase robustness of max_prob_rate*/
minstrel_ht_prob_rate_reduce_streams(mi); minstrel_ht_prob_rate_reduce_streams(mi);
/* try to sample all available rates during each interval */ /* try to sample half of all available rates during each interval */
mi->sample_count *= 8; mi->sample_count *= 4;
if (mp->new_avg)
mi->sample_count /= 2;
if (sample) if (sample)
minstrel_ht_rate_sample_switch(mp, mi); minstrel_ht_rate_sample_switch(mp, mi);
...@@ -1040,7 +1029,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, ...@@ -1040,7 +1029,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
struct ieee80211_tx_rate *ar = info->status.rates; struct ieee80211_tx_rate *ar = info->status.rates;
struct minstrel_rate_stats *rate, *rate2, *rate_sample = NULL; struct minstrel_rate_stats *rate, *rate2, *rate_sample = NULL;
struct minstrel_priv *mp = priv; struct minstrel_priv *mp = priv;
u32 update_interval = mp->update_interval / 2; u32 update_interval = mp->update_interval;
bool last, update = false; bool last, update = false;
bool sample_status = false; bool sample_status = false;
int i; int i;
...@@ -1090,9 +1079,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, ...@@ -1090,9 +1079,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
switch (mi->sample_mode) { switch (mi->sample_mode) {
case MINSTREL_SAMPLE_IDLE: case MINSTREL_SAMPLE_IDLE:
if (mp->new_avg && if (mp->hw->max_rates > 1 ||
(mp->hw->max_rates > 1 || mi->total_packets_cur < SAMPLE_SWITCH_THR)
mi->total_packets_cur < SAMPLE_SWITCH_THR))
update_interval /= 2; update_interval /= 2;
break; break;
...@@ -1832,8 +1820,7 @@ minstrel_ht_alloc(struct ieee80211_hw *hw) ...@@ -1832,8 +1820,7 @@ minstrel_ht_alloc(struct ieee80211_hw *hw)
mp->has_mrr = true; mp->has_mrr = true;
mp->hw = hw; mp->hw = hw;
mp->update_interval = HZ / 10; mp->update_interval = HZ / 20;
mp->new_avg = true;
minstrel_ht_init_cck_rates(mp); minstrel_ht_init_cck_rates(mp);
for (i = 0; i < ARRAY_SIZE(mp->hw->wiphy->bands); i++) for (i = 0; i < ARRAY_SIZE(mp->hw->wiphy->bands); i++)
...@@ -1853,8 +1840,6 @@ static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv, ...@@ -1853,8 +1840,6 @@ static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv,
&mp->fixed_rate_idx); &mp->fixed_rate_idx);
debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir, debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir,
&mp->sample_switch); &mp->sample_switch);
debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir,
&mp->new_avg);
} }
#endif #endif
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
struct minstrel_priv { struct minstrel_priv {
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
bool has_mrr; bool has_mrr;
bool new_avg;
u32 sample_switch; u32 sample_switch;
unsigned int cw_min; unsigned int cw_min;
unsigned int cw_max; unsigned int cw_max;
......
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