Skip to content

Improve ath10k flush queue mechanism

Remi Pommarel ath10k linux-wireless lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/22 patches 7 repliesIn review
  2. v3 posting 1/22 patches 0 repliesSuperseded
  3. v22 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches7 repliesSuperseded

Changes in v3 from the cover letter

- Initialize empty to true to fix smatch error

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2wifi: ath10k: Implement ieee80211 flush_sta callbackdrivers/net/wireless/ath/ath10k/core.h drivers/net/wireless/ath/ath10k/htt.h drivers/net/wireless/ath/ath10k/htt_tx.c +2 more+82 -40 replies
2/2wifi: ath10k: Flush only requested txq in ath10k_flush()drivers/net/wireless/ath/ath10k/htt.h drivers/net/wireless/ath/ath10k/htt_tx.c drivers/net/wireless/ath/ath10k/mac.c +1 more+45 -171 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchFlorian Maurer
1/2
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [RESEND PATCH v3 0/2] Improve ath10k flush queue mechanism

It has been reported [0] that a 3-4 seconds (actually up to 5 sec) of radio silence could be observed followed by the error below on ath10k devices:

ath10k_pci 0000:04:00.0: failed to flush transmit queue (skip 0 ar-state 1): 0

This is due to how the TX queues are flushed in ath10k. When a STA is removed, mac80211 need to flush queues [1], but because ath10k does not have a lightweight .flush_sta operation, ieee80211_flush_queues() is called instead effectively blocking the whole queue during the drain causing this radio silence. Also because ath10k_flush() waits for all queued to be emptied, not only the flushed ones it could more easily take up to 5 seconds to finish making the whole situation worst.

The first patch of this series adds a .flush_sta operation to flush only specific STA traffic avoiding the need to stop whole queues and should be enough in itself to fix the reported issue.

The second patch of this series is a proposal to improve ath10k_flush so that it will be less likely to timeout waiting for non related queues to drain.

The abose kernel warning could still be observed (e.g. flushing a dead STA) but should be now harmless.

[0]: https://lore.kernel.org/all/CA+Xfe4FjUmzM5mvPxGbpJsF3SvSdE5_wgxvgFJ0bsdrKODVXCQ@mail.gmail.com/
[1]: commit 0b75a1b1e42e ("wifi: mac80211: flush queues on STA removal")

V3:
- Initialize empty to true to fix smatch error

V2:
- Add Closes tag
- Use atomic instead of spinlock for per sta pending frame counter
- Call ath10k_htt_tx_sta_dec_pending within rcu
- Rename pending_per_queue[] to num_pending_per_queue[]

Remi Pommarel (2):
wifi: ath10k: Implement ieee80211 flush_sta callback
wifi: ath10k: Flush only requested txq in ath10k_flush()

 drivers/net/wireless/ath/ath10k/core.h   |  2 +
 drivers/net/wireless/ath/ath10k/htt.h    | 11 +++-
 drivers/net/wireless/ath/ath10k/htt_tx.c | 49 +++++++++++++++-
 drivers/net/wireless/ath/ath10k/mac.c    | 75 ++++++++++++++++++++----
 drivers/net/wireless/ath/ath10k/txrx.c   | 11 ++--
 5 files changed, 127 insertions(+), 21 deletions(-)
Signature · 1 line
2.40.0