aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-20 20:47:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:21 -0500
commitc7317e41df30c7e04dca46360e5ebb0cb36dda45 (patch)
tree0bb263d5199d54da70942182d0a234d1cbfb8070 /net/mac80211
parentff32d9cd2c4107224a28f39d3c72eec66d566e09 (diff)
mac80211: minstrel_ht - reduce the overhead of rate sampling
- reduce the number of retransmission attempts for sample rates - sample lower rates less often - do not use RTS/CTS for sampling frames - increase the time between sampling attempts Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rc80211_minstrel_ht.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 2a18d6602d4a..2d6f0259e0c6 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -407,8 +407,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
407 mi->ampdu_len += info->status.ampdu_len; 407 mi->ampdu_len += info->status.ampdu_len;
408 408
409 if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) { 409 if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) {
410 mi->sample_wait = 4 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len); 410 mi->sample_wait = 16 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len);
411 mi->sample_tries = 3; 411 mi->sample_tries = 2;
412 mi->sample_count--; 412 mi->sample_count--;
413 } 413 }
414 414
@@ -506,7 +506,9 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
506 if (!mr->retry_updated) 506 if (!mr->retry_updated)
507 minstrel_calc_retransmit(mp, mi, index); 507 minstrel_calc_retransmit(mp, mi, index);
508 508
509 if (mr->probability < MINSTREL_FRAC(20, 100)) 509 if (sample)
510 rate->count = 1;
511 else if (mr->probability < MINSTREL_FRAC(20, 100))
510 rate->count = 2; 512 rate->count = 2;
511 else if (rtscts) 513 else if (rtscts)
512 rate->count = mr->retry_count_rtscts; 514 rate->count = mr->retry_count_rtscts;
@@ -562,7 +564,7 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
562 */ 564 */
563 if (minstrel_get_duration(sample_idx) > 565 if (minstrel_get_duration(sample_idx) >
564 minstrel_get_duration(mi->max_tp_rate)) { 566 minstrel_get_duration(mi->max_tp_rate)) {
565 if (mr->sample_skipped < 10) 567 if (mr->sample_skipped < 20)
566 goto next; 568 goto next;
567 569
568 if (mi->sample_slow++ > 2) 570 if (mi->sample_slow++ > 2)
@@ -586,6 +588,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
586 struct minstrel_ht_sta *mi = &msp->ht; 588 struct minstrel_ht_sta *mi = &msp->ht;
587 struct minstrel_priv *mp = priv; 589 struct minstrel_priv *mp = priv;
588 int sample_idx; 590 int sample_idx;
591 bool sample = false;
589 592
590 if (rate_control_send_low(sta, priv_sta, txrc)) 593 if (rate_control_send_low(sta, priv_sta, txrc))
591 return; 594 return;
@@ -596,10 +599,11 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
596 info->flags |= mi->tx_flags; 599 info->flags |= mi->tx_flags;
597 sample_idx = minstrel_get_sample_rate(mp, mi); 600 sample_idx = minstrel_get_sample_rate(mp, mi);
598 if (sample_idx >= 0) { 601 if (sample_idx >= 0) {
602 sample = true;
599 minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, 603 minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx,
600 txrc, true, false); 604 txrc, true, false);
601 minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, 605 minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate,
602 txrc, false, true); 606 txrc, false, false);
603 info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; 607 info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
604 } else { 608 } else {
605 minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, 609 minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate,
@@ -607,7 +611,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
607 minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, 611 minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2,
608 txrc, false, true); 612 txrc, false, true);
609 } 613 }
610 minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, true); 614 minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, !sample);
611 615
612 ar[3].count = 0; 616 ar[3].count = 0;
613 ar[3].idx = -1; 617 ar[3].idx = -1;