aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2014-04-06 11:13:22 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-04-13 09:51:04 -0400
commit87d5e4155c0088e6766b4f0193b63fa0eab71220 (patch)
treef3b085549d06ee7934d2856a2b82b55374bf893b /drivers/net/wireless/iwlwifi
parente53839eb9882c99d3781eab0fe1b2d4369a6a2cc (diff)
iwlwifi: mvm: rs: reinit rs if no tx for a long time
After being idle for a long time (>5sec) the rs statistics will be stale so we prefer to reset rs and start from legacy rates again. This gives better results when the attenuation increased signficantly (e.g. we got further from the AP) and after a while we start Tx Note that the first Tx after the idle period will still go out in the old modulation and rate but this seemed a simpler approach compared to adding a timer or modifying mac80211 for this. The negative impact is negligble as we'll recover quickly. Cc: <stable@vger.kernel.org> [3.14] Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.c22
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index 97b8fac214a1..0d03dcd2fc3d 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -59,7 +59,7 @@
59/* max allowed rate miss before sync LQ cmd */ 59/* max allowed rate miss before sync LQ cmd */
60#define IWL_MISSED_RATE_MAX 15 60#define IWL_MISSED_RATE_MAX 15
61#define RS_STAY_IN_COLUMN_TIMEOUT (5*HZ) 61#define RS_STAY_IN_COLUMN_TIMEOUT (5*HZ)
62 62#define RS_IDLE_TIMEOUT (5*HZ)
63 63
64static u8 rs_ht_to_legacy[] = { 64static u8 rs_ht_to_legacy[] = {
65 [IWL_RATE_MCS_0_INDEX] = IWL_RATE_6M_INDEX, 65 [IWL_RATE_MCS_0_INDEX] = IWL_RATE_6M_INDEX,
@@ -992,6 +992,13 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband,
992 return; 992 return;
993 } 993 }
994 994
995#ifdef CPTCFG_MAC80211_DEBUGFS
996 /* Disable last tx check if we are debugging with fixed rate */
997 if (lq_sta->dbg_fixed_rate) {
998 IWL_DEBUG_RATE(mvm, "Fixed rate. avoid rate scaling\n");
999 return;
1000 }
1001#endif
995 if (!ieee80211_is_data(hdr->frame_control) || 1002 if (!ieee80211_is_data(hdr->frame_control) ||
996 info->flags & IEEE80211_TX_CTL_NO_ACK) 1003 info->flags & IEEE80211_TX_CTL_NO_ACK)
997 return; 1004 return;
@@ -1034,6 +1041,18 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband,
1034 mac_index++; 1041 mac_index++;
1035 } 1042 }
1036 1043
1044 if (time_after(jiffies,
1045 (unsigned long)(lq_sta->last_tx + RS_IDLE_TIMEOUT))) {
1046 int tid;
1047 IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n");
1048 for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++)
1049 ieee80211_stop_tx_ba_session(sta, tid);
1050
1051 iwl_mvm_rs_rate_init(mvm, sta, sband->band, false);
1052 return;
1053 }
1054 lq_sta->last_tx = jiffies;
1055
1037 /* Here we actually compare this rate to the latest LQ command */ 1056 /* Here we actually compare this rate to the latest LQ command */
1038 if ((mac_index < 0) || 1057 if ((mac_index < 0) ||
1039 (rate.sgi != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) || 1058 (rate.sgi != !!(mac_flags & IEEE80211_TX_RC_SHORT_GI)) ||
@@ -2354,6 +2373,7 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
2354 rs_rate_scale_clear_tbl_windows(&lq_sta->lq_info[j]); 2373 rs_rate_scale_clear_tbl_windows(&lq_sta->lq_info[j]);
2355 2374
2356 lq_sta->flush_timer = 0; 2375 lq_sta->flush_timer = 0;
2376 lq_sta->last_tx = jiffies;
2357 2377
2358 IWL_DEBUG_RATE(mvm, 2378 IWL_DEBUG_RATE(mvm,
2359 "LQ: *** rate scale station global init for station %d ***\n", 2379 "LQ: *** rate scale station global init for station %d ***\n",
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.h b/drivers/net/wireless/iwlwifi/mvm/rs.h
index fbb476aadb22..0acfac96a56c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.h
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.h
@@ -311,6 +311,7 @@ struct iwl_lq_sta {
311 u32 visited_columns; /* Bitmask marking which Tx columns were 311 u32 visited_columns; /* Bitmask marking which Tx columns were
312 * explored during a search cycle 312 * explored during a search cycle
313 */ 313 */
314 u64 last_tx;
314 bool is_vht; 315 bool is_vht;
315 enum ieee80211_band band; 316 enum ieee80211_band band;
316 317