diff options
author | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2024-05-05 09:19:50 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-05-06 16:33:23 +0200 |
commit | ec0d43d26f2ca40d3bfb0678985a6ed1e9ed3887 (patch) | |
tree | 140e6593606556513f4741bd3c40a0877aaa27a6 /drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | |
parent | 1d52e8ca4cba508011fb5a50b968116a2317642a (diff) | |
download | linux-stable-ec0d43d26f2ca40d3bfb0678985a6ed1e9ed3887.tar.gz linux-stable-ec0d43d26f2ca40d3bfb0678985a6ed1e9ed3887.tar.bz2 linux-stable-ec0d43d26f2ca40d3bfb0678985a6ed1e9ed3887.zip |
wifi: iwlwifi: mvm: Activate EMLSR based on traffic volume
Adjust EMLSR activation to account for traffic levels. By
tracking the number of RX/TX MPDUs, EMLSR will be activated only when
traffic volume meets the required threshold.
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240505091420.9480f99ac8fc.If9eb946e929a39e10fe5f4638bc8bc3f8976edf1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 5609b0321647..305f194ae7b2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -207,6 +207,30 @@ static unsigned int iwl_mvm_mld_count_active_links(struct iwl_mvm_vif *mvmvif) return n_active; } +static void iwl_mvm_restart_mpdu_count(struct iwl_mvm *mvm, + struct iwl_mvm_vif *mvmvif) +{ + struct ieee80211_sta *ap_sta = mvmvif->ap_sta; + struct iwl_mvm_sta *mvmsta; + + lockdep_assert_held(&mvm->mutex); + + if (!ap_sta) + return; + + mvmsta = iwl_mvm_sta_from_mac80211(ap_sta); + if (!mvmsta->mpdu_counters) + return; + + for (int q = 0; q < mvm->trans->num_rx_queues; q++) { + spin_lock_bh(&mvmsta->mpdu_counters[q].lock); + memset(mvmsta->mpdu_counters[q].per_link, 0, + sizeof(mvmsta->mpdu_counters[q].per_link)); + mvmsta->mpdu_counters[q].window_start = jiffies; + spin_unlock_bh(&mvmsta->mpdu_counters[q].lock); + } +} + static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { @@ -243,6 +267,13 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm, /* Needed for tracking RSSI */ iwl_mvm_request_periodic_system_statistics(mvm, true); + /* + * Restart the MPDU counters and the counting window, so when the + * statistics arrive (which is where we look at the counters) we + * will be at the end of the window. + */ + iwl_mvm_restart_mpdu_count(mvm, mvmvif); + return ret; } @@ -412,6 +443,9 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm, iwl_mvm_request_periodic_system_statistics(mvm, false); + /* Start a new counting window */ + iwl_mvm_restart_mpdu_count(mvm, mvmvif); + return ret; } |