From ad06ff1186a055552e4e430b1f40593b9668b439 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 21 Oct 2010 00:33:00 +0000 Subject: [PATCH] ath9k: fix sampling frame handling wrt. aggregation, replace minstrel_ht performance fixes for better performance SVN-Revision: 23558 --- .../patches/560-ath9k_aggr_sampling_fix.patch | 22 ++++++++ .../patches/560-minstrel_ht_performance.patch | 32 ------------ .../561-minstrel_ht_sampling_interval.patch | 11 ---- .../561-minstrel_sample_retransmit.patch | 13 +++++ .../562-minstrel_sample_performance.patch | 52 +++++++++++++++++++ 5 files changed, 87 insertions(+), 43 deletions(-) create mode 100644 package/mac80211/patches/560-ath9k_aggr_sampling_fix.patch delete mode 100644 package/mac80211/patches/560-minstrel_ht_performance.patch delete mode 100644 package/mac80211/patches/561-minstrel_ht_sampling_interval.patch create mode 100644 package/mac80211/patches/561-minstrel_sample_retransmit.patch create mode 100644 package/mac80211/patches/562-minstrel_sample_performance.patch diff --git a/package/mac80211/patches/560-ath9k_aggr_sampling_fix.patch b/package/mac80211/patches/560-ath9k_aggr_sampling_fix.patch new file mode 100644 index 0000000000..66a3419019 --- /dev/null +++ b/package/mac80211/patches/560-ath9k_aggr_sampling_fix.patch @@ -0,0 +1,22 @@ +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -673,6 +673,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_ + u16 aggr_limit = 0, al = 0, bpad = 0, + al_delta, h_baw = tid->baw_size / 2; + enum ATH_AGGR_STATUS status = ATH_AGGR_DONE; ++ struct ieee80211_tx_info *tx_info; + + bf_first = list_first_entry(&tid->buf_q, struct ath_buf, list); + +@@ -699,6 +700,11 @@ static enum ATH_AGGR_STATUS ath_tx_form_ + break; + } + ++ tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); ++ if (nframes && ((tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) || ++ !(tx_info->control.rates[0].flags & IEEE80211_TX_RC_MCS))) ++ break; ++ + /* do not exceed subframe limit */ + if (nframes >= min((int)h_baw, ATH_AMPDU_SUBFRAME_DEFAULT)) { + status = ATH_AGGR_LIMITED; diff --git a/package/mac80211/patches/560-minstrel_ht_performance.patch b/package/mac80211/patches/560-minstrel_ht_performance.patch deleted file mode 100644 index a3e7f424ad..0000000000 --- a/package/mac80211/patches/560-minstrel_ht_performance.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/mac80211/rc80211_minstrel_ht.h -+++ b/net/mac80211/rc80211_minstrel_ht.h -@@ -103,6 +103,7 @@ struct minstrel_ht_sta { - u8 sample_tries; - u8 sample_count; - u8 sample_slow; -+ u8 sample_retry; - - /* current MCS group to be sampled */ - u8 sample_group; ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -261,6 +261,7 @@ minstrel_ht_update_stats(struct minstrel - - /* try to sample up to half of the availble rates during each interval */ - mi->sample_count *= 4; -+ mi->sample_retry = mi->sample_count; - - cur_prob = 0; - cur_prob_tp = 0; -@@ -572,6 +573,11 @@ minstrel_get_sample_rate(struct minstrel - return sample_idx; - - next: -+ if (mi->sample_retry > 0) { -+ mi->sample_retry--; -+ mi->sample_tries++; -+ mi->sample_wait = 1; -+ } - minstrel_next_sample_idx(mi); - return -1; - } diff --git a/package/mac80211/patches/561-minstrel_ht_sampling_interval.patch b/package/mac80211/patches/561-minstrel_ht_sampling_interval.patch deleted file mode 100644 index f9465e8be1..0000000000 --- a/package/mac80211/patches/561-minstrel_ht_sampling_interval.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -408,7 +408,7 @@ minstrel_ht_tx_status(void *priv, struct - mi->ampdu_len += info->status.ampdu_len; - - if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) { -- mi->sample_wait = 4 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len); -+ mi->sample_wait = 8 + MINSTREL_TRUNC(mi->avg_ampdu_len); - mi->sample_tries = 3; - mi->sample_count--; - } diff --git a/package/mac80211/patches/561-minstrel_sample_retransmit.patch b/package/mac80211/patches/561-minstrel_sample_retransmit.patch new file mode 100644 index 0000000000..2ae03d8787 --- /dev/null +++ b/package/mac80211/patches/561-minstrel_sample_retransmit.patch @@ -0,0 +1,13 @@ +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -506,7 +506,9 @@ minstrel_ht_set_rate(struct minstrel_pri + if (!mr->retry_updated) + minstrel_calc_retransmit(mp, mi, index); + +- if (mr->probability < MINSTREL_FRAC(20, 100)) ++ if (sample) ++ rate->count = 1; ++ else if (mr->probability < MINSTREL_FRAC(20, 100)) + rate->count = 2; + else if (rtscts) + rate->count = mr->retry_count_rtscts; diff --git a/package/mac80211/patches/562-minstrel_sample_performance.patch b/package/mac80211/patches/562-minstrel_sample_performance.patch new file mode 100644 index 0000000000..424a741609 --- /dev/null +++ b/package/mac80211/patches/562-minstrel_sample_performance.patch @@ -0,0 +1,52 @@ +--- 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 + mi->ampdu_len += info->status.ampdu_len; + + if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) { +- mi->sample_wait = 4 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len); +- mi->sample_tries = 3; ++ mi->sample_wait = 16 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len); ++ mi->sample_tries = 2; + mi->sample_count--; + } + +@@ -564,7 +564,7 @@ minstrel_get_sample_rate(struct minstrel + */ + if (minstrel_get_duration(sample_idx) > + minstrel_get_duration(mi->max_tp_rate)) { +- if (mr->sample_skipped < 10) ++ if (mr->sample_skipped < 20) + goto next; + + if (mi->sample_slow++ > 2) +@@ -588,6 +588,7 @@ minstrel_ht_get_rate(void *priv, struct + struct minstrel_ht_sta *mi = &msp->ht; + struct minstrel_priv *mp = priv; + int sample_idx; ++ bool sample = false; + + if (rate_control_send_low(sta, priv_sta, txrc)) + return; +@@ -598,10 +599,11 @@ minstrel_ht_get_rate(void *priv, struct + info->flags |= mi->tx_flags; + sample_idx = minstrel_get_sample_rate(mp, mi); + if (sample_idx >= 0) { ++ sample = true; + minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, + txrc, true, false); + minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, +- txrc, false, true); ++ txrc, false, false); + info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; + } else { + minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, +@@ -609,7 +611,7 @@ minstrel_ht_get_rate(void *priv, struct + minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, + txrc, false, true); + } +- minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, true); ++ minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, !sample); + + ar[3].count = 0; + ar[3].idx = -1; -- 2.30.2