diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-10-05 02:11:14 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-10-23 14:21:48 -0400 |
commit | a0855054e59b0c5b2b00237fdb5147f7bcc18efb (patch) | |
tree | ae354fa794649e4e9e7c9082a471f69c8e288856 | |
parent | a6cc5163149532734b84c86cbffa4994e527074b (diff) |
iwlwifi: dvm: drop non VO frames when flushing
When mac80211 wants to ensure that a frame is sent, it calls
the flush() callback. Until now, iwldvm implemented this by
waiting that all the frames are sent (ACKed or timeout).
In case of weak signal, this can take a significant amount
of time, delaying the next connection (in case of roaming).
Many users have reported that the flush would take too long
leading to the following error messages to be printed:
iwlwifi 0000:03:00.0: fail to flush all tx fifo queues Q 2
iwlwifi 0000:03:00.0: Current SW read_ptr 161 write_ptr 201
iwl data: 00000000: 00 00 00 00 00 00 00 00 fe ff 01 00 00 00 00 00
[snip]
iwlwifi 0000:03:00.0: FH TRBs(0) = 0x00000000
[snip]
iwlwifi 0000:03:00.0: Q 0 is active and mapped to fifo 3 ra_tid 0x0000 [9,9]
[snip]
Instead of waiting for these packets, simply drop them. This
significantly improves the responsiveness of the network.
Note that all the queues are flushed, but the VO one. This
is not typically used by the applications and it likely
contains management frames that are useful for connection
or roaming.
This bug is tracked here:
https://bugzilla.kernel.org/show_bug.cgi?id=56581
But it is duplicated in distributions' trackers.
A simple search in Ubuntu's database led to these bugs:
https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1270808
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1305406
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1356236
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1360597
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1361809
Cc: <stable@vger.kernel.org>
Depends-on: 77be2c54c5bd ("mac80211: add vif to flush call")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/mac80211.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c index 2364a3c09b9e..cae692ff1013 100644 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c | |||
@@ -1095,6 +1095,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1095 | u32 queues, bool drop) | 1095 | u32 queues, bool drop) |
1096 | { | 1096 | { |
1097 | struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); | 1097 | struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); |
1098 | u32 scd_queues; | ||
1098 | 1099 | ||
1099 | mutex_lock(&priv->mutex); | 1100 | mutex_lock(&priv->mutex); |
1100 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 1101 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
@@ -1108,18 +1109,19 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1108 | goto done; | 1109 | goto done; |
1109 | } | 1110 | } |
1110 | 1111 | ||
1111 | /* | 1112 | scd_queues = BIT(priv->cfg->base_params->num_of_queues) - 1; |
1112 | * mac80211 will not push any more frames for transmit | 1113 | scd_queues &= ~(BIT(IWL_IPAN_CMD_QUEUE_NUM) | |
1113 | * until the flush is completed | 1114 | BIT(IWL_DEFAULT_CMD_QUEUE_NUM)); |
1114 | */ | 1115 | |
1115 | if (drop) { | 1116 | if (vif) |
1116 | IWL_DEBUG_MAC80211(priv, "send flush command\n"); | 1117 | scd_queues &= ~BIT(vif->hw_queue[IEEE80211_AC_VO]); |
1117 | if (iwlagn_txfifo_flush(priv, 0)) { | 1118 | |
1118 | IWL_ERR(priv, "flush request fail\n"); | 1119 | IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n", scd_queues); |
1119 | goto done; | 1120 | if (iwlagn_txfifo_flush(priv, scd_queues)) { |
1120 | } | 1121 | IWL_ERR(priv, "flush request fail\n"); |
1122 | goto done; | ||
1121 | } | 1123 | } |
1122 | IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n"); | 1124 | IWL_DEBUG_TX_QUEUES(priv, "wait transmit/flush all frames\n"); |
1123 | iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff); | 1125 | iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff); |
1124 | done: | 1126 | done: |
1125 | mutex_unlock(&priv->mutex); | 1127 | mutex_unlock(&priv->mutex); |