diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-03-02 15:20:13 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 10:35:52 -0500 |
commit | a299c6d591f8f6abfe42e77d70ed688067748135 (patch) | |
tree | 6d0d49842ab545badf31240ff2beb254d579e0ab | |
parent | ed97a13c540eb8fdbb6250eaa6471a4263204af8 (diff) |
mac80211/minstrel_ht: improve max_prob_rate selection
max_prob_rate should be selected to be very reliable, however limiting
it to single-stream on 3-stream devices is a bit much.
Allow max_prob_rate to use one stream less than the max_tp_rate.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 0b5cdd94d4f0..6c735e0d66a3 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -246,6 +246,7 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
246 | struct minstrel_rate_stats *mr; | 246 | struct minstrel_rate_stats *mr; |
247 | int cur_prob, cur_prob_tp, cur_tp, cur_tp2; | 247 | int cur_prob, cur_prob_tp, cur_tp, cur_tp2; |
248 | int group, i, index; | 248 | int group, i, index; |
249 | int prob_max_streams = 1; | ||
249 | 250 | ||
250 | if (mi->ampdu_packets > 0) { | 251 | if (mi->ampdu_packets > 0) { |
251 | mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len, | 252 | mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len, |
@@ -323,20 +324,13 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
323 | if (!mg->supported) | 324 | if (!mg->supported) |
324 | continue; | 325 | continue; |
325 | 326 | ||
326 | mr = minstrel_get_ratestats(mi, mg->max_prob_rate); | ||
327 | if (cur_prob_tp < mr->cur_tp && | ||
328 | minstrel_mcs_groups[group].streams == 1) { | ||
329 | mi->max_prob_rate = mg->max_prob_rate; | ||
330 | cur_prob = mr->cur_prob; | ||
331 | cur_prob_tp = mr->cur_tp; | ||
332 | } | ||
333 | |||
334 | mr = minstrel_get_ratestats(mi, mg->max_tp_rate); | 327 | mr = minstrel_get_ratestats(mi, mg->max_tp_rate); |
335 | if (cur_tp < mr->cur_tp) { | 328 | if (cur_tp < mr->cur_tp) { |
336 | mi->max_tp_rate2 = mi->max_tp_rate; | 329 | mi->max_tp_rate2 = mi->max_tp_rate; |
337 | cur_tp2 = cur_tp; | 330 | cur_tp2 = cur_tp; |
338 | mi->max_tp_rate = mg->max_tp_rate; | 331 | mi->max_tp_rate = mg->max_tp_rate; |
339 | cur_tp = mr->cur_tp; | 332 | cur_tp = mr->cur_tp; |
333 | prob_max_streams = minstrel_mcs_groups[group].streams - 1; | ||
340 | } | 334 | } |
341 | 335 | ||
342 | mr = minstrel_get_ratestats(mi, mg->max_tp_rate2); | 336 | mr = minstrel_get_ratestats(mi, mg->max_tp_rate2); |
@@ -346,6 +340,23 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
346 | } | 340 | } |
347 | } | 341 | } |
348 | 342 | ||
343 | if (prob_max_streams < 1) | ||
344 | prob_max_streams = 1; | ||
345 | |||
346 | for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) { | ||
347 | mg = &mi->groups[group]; | ||
348 | if (!mg->supported) | ||
349 | continue; | ||
350 | mr = minstrel_get_ratestats(mi, mg->max_prob_rate); | ||
351 | if (cur_prob_tp < mr->cur_tp && | ||
352 | minstrel_mcs_groups[group].streams <= prob_max_streams) { | ||
353 | mi->max_prob_rate = mg->max_prob_rate; | ||
354 | cur_prob = mr->cur_prob; | ||
355 | cur_prob_tp = mr->cur_tp; | ||
356 | } | ||
357 | } | ||
358 | |||
359 | |||
349 | mi->stats_update = jiffies; | 360 | mi->stats_update = jiffies; |
350 | } | 361 | } |
351 | 362 | ||