Commit 5d42e7b2 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach

iwlwifi: mvm: allow to configure the timeout for the Tx queues

Sometimes we will want to configure the timeouts for the
Tx queues based on the vif type. Allow to do that using the
trigger mechanism.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 5dd9c68a
...@@ -250,6 +250,8 @@ iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data) ...@@ -250,6 +250,8 @@ iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data)
* @FW_DBG_TRIGGER_STATS: trigger log collection upon statistics threshold. * @FW_DBG_TRIGGER_STATS: trigger log collection upon statistics threshold.
* @FW_DBG_TRIGGER_RSSI: trigger log collection when the rssi of the beacon * @FW_DBG_TRIGGER_RSSI: trigger log collection when the rssi of the beacon
* goes below a threshold. * goes below a threshold.
* @FW_DBG_TRIGGER_TXQ_TIMERS: configures the timers for the Tx queue hang
* detection.
*/ */
enum iwl_fw_dbg_trigger { enum iwl_fw_dbg_trigger {
FW_DBG_TRIGGER_INVALID = 0, FW_DBG_TRIGGER_INVALID = 0,
...@@ -261,6 +263,7 @@ enum iwl_fw_dbg_trigger { ...@@ -261,6 +263,7 @@ enum iwl_fw_dbg_trigger {
FW_DB_TRIGGER_RESERVED, FW_DB_TRIGGER_RESERVED,
FW_DBG_TRIGGER_STATS, FW_DBG_TRIGGER_STATS,
FW_DBG_TRIGGER_RSSI, FW_DBG_TRIGGER_RSSI,
FW_DBG_TRIGGER_TXQ_TIMERS,
/* must be last */ /* must be last */
FW_DBG_TRIGGER_MAX, FW_DBG_TRIGGER_MAX,
......
...@@ -578,6 +578,29 @@ struct iwl_fw_dbg_trigger_low_rssi { ...@@ -578,6 +578,29 @@ struct iwl_fw_dbg_trigger_low_rssi {
__le32 rssi; __le32 rssi;
} __packed; } __packed;
/**
* struct iwl_fw_dbg_trigger_txq_timer - configures the Tx queue's timer
* @command_queue: timeout for the command queue in ms
* @bss: timeout for the queues of a BSS (except for TDLS queues) in ms
* @softap: timeout for the queues of a softAP in ms
* @p2p_go: timeout for the queues of a P2P GO in ms
* @p2p_client: timeout for the queues of a P2P client in ms
* @p2p_device: timeout for the queues of a P2P device in ms
* @ibss: timeout for the queues of an IBSS in ms
* @tdls: timeout for the queues of a TDLS station in ms
*/
struct iwl_fw_dbg_trigger_txq_timer {
__le32 command_queue;
__le32 bss;
__le32 softap;
__le32 p2p_go;
__le32 p2p_client;
__le32 p2p_device;
__le32 ibss;
__le32 tdls;
__le32 reserved[4];
} __packed;
/** /**
* struct iwl_fw_dbg_conf_tlv - a TLV that describes a debug configuration. * struct iwl_fw_dbg_conf_tlv - a TLV that describes a debug configuration.
* @id: conf id * @id: conf id
......
...@@ -470,9 +470,8 @@ static int iwl_mvm_mac_ctxt_allocate_resources(struct iwl_mvm *mvm, ...@@ -470,9 +470,8 @@ static int iwl_mvm_mac_ctxt_allocate_resources(struct iwl_mvm *mvm,
int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{ {
unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? unsigned int wdg_timeout =
mvm->cfg->base_params->wd_timeout : iwl_mvm_get_wd_timeout(mvm, vif, false, false);
IWL_WATCHDOG_DISABLED;
u32 ac; u32 ac;
int ret; int ret;
......
...@@ -1480,7 +1480,9 @@ void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm); ...@@ -1480,7 +1480,9 @@ void iwl_mvm_free_fw_dump_desc(struct iwl_mvm *mvm);
int iwl_mvm_fw_dbg_collect_trig(struct iwl_mvm *mvm, int iwl_mvm_fw_dbg_collect_trig(struct iwl_mvm *mvm,
struct iwl_fw_dbg_trigger_tlv *trigger, struct iwl_fw_dbg_trigger_tlv *trigger,
const char *str, size_t len); const char *str, size_t len);
unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
bool tdls, bool cmd_q);
static inline bool static inline bool
iwl_fw_dbg_trigger_vif_match(struct iwl_fw_dbg_trigger_tlv *trig, iwl_fw_dbg_trigger_vif_match(struct iwl_fw_dbg_trigger_tlv *trig,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
......
...@@ -488,8 +488,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -488,8 +488,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
/* Set a short watchdog for the command queue */ /* Set a short watchdog for the command queue */
trans_cfg.cmd_q_wdg_timeout = trans_cfg.cmd_q_wdg_timeout =
iwlmvm_mod_params.tfd_q_hang_detect ? IWL_DEF_WD_TIMEOUT : iwl_mvm_get_wd_timeout(mvm, NULL, false, true);
IWL_WATCHDOG_DISABLED;
snprintf(mvm->hw->wiphy->fw_version, snprintf(mvm->hw->wiphy->fw_version,
sizeof(mvm->hw->wiphy->fw_version), sizeof(mvm->hw->wiphy->fw_version),
......
...@@ -209,9 +209,8 @@ static int iwl_mvm_tdls_sta_init(struct iwl_mvm *mvm, ...@@ -209,9 +209,8 @@ static int iwl_mvm_tdls_sta_init(struct iwl_mvm *mvm,
{ {
unsigned long used_hw_queues; unsigned long used_hw_queues;
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? unsigned int wdg_timeout =
mvm->cfg->base_params->wd_timeout : iwl_mvm_get_wd_timeout(mvm, NULL, true, false);
IWL_WATCHDOG_DISABLED;
u32 ac; u32 ac;
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
...@@ -981,9 +980,8 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -981,9 +980,8 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
{ {
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
unsigned int wdg_timeout = iwlmvm_mod_params.tfd_q_hang_detect ? unsigned int wdg_timeout =
mvm->cfg->base_params->wd_timeout : iwl_mvm_get_wd_timeout(mvm, vif, sta->tdls, false);
IWL_WATCHDOG_DISABLED;
int queue, fifo, ret; int queue, fifo, ret;
u16 ssn; u16 ssn;
......
...@@ -921,3 +921,47 @@ struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm) ...@@ -921,3 +921,47 @@ struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm)
return bss_iter_data.vif; return bss_iter_data.vif;
} }
unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
bool tdls, bool cmd_q)
{
struct iwl_fw_dbg_trigger_tlv *trigger;
struct iwl_fw_dbg_trigger_txq_timer *txq_timer;
unsigned int default_timeout =
cmd_q ? IWL_DEF_WD_TIMEOUT : mvm->cfg->base_params->wd_timeout;
if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS))
return iwlmvm_mod_params.tfd_q_hang_detect ?
default_timeout : IWL_WATCHDOG_DISABLED;
trigger = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS);
txq_timer = (void *)trigger->data;
if (tdls)
return le32_to_cpu(txq_timer->tdls);
if (cmd_q)
return le32_to_cpu(txq_timer->command_queue);
if (WARN_ON(!vif))
return default_timeout;
switch (ieee80211_vif_type_p2p(vif)) {
case NL80211_IFTYPE_ADHOC:
return le32_to_cpu(txq_timer->ibss);
case NL80211_IFTYPE_STATION:
return le32_to_cpu(txq_timer->bss);
case NL80211_IFTYPE_AP:
return le32_to_cpu(txq_timer->softap);
case NL80211_IFTYPE_P2P_CLIENT:
return le32_to_cpu(txq_timer->p2p_client);
case NL80211_IFTYPE_P2P_GO:
return le32_to_cpu(txq_timer->p2p_go);
case NL80211_IFTYPE_P2P_DEVICE:
return le32_to_cpu(txq_timer->p2p_device);
default:
WARN_ON(1);
return mvm->cfg->base_params->wd_timeout;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment