[PATCH v2 0/2] wifi: ath9k: fix loss of non-aggregate frames
From: Tomas Tonhauser
Date: Wed Oct 28 2026 - 13:26:09 EST
Non-aggregate frames (stations without an A-MPDU session, e.g.
non-WMM ESP8266 clients) are lost on ath9k in two ways:
1. The hardware filters them (ATH9K_TXERR_FILT) while the station
is awake, and mac80211 retries a filtered frame only once.
Patch 1 sets CLRDMASK on every non-aggregate frame.
2. Frames that exhaust the hardware retry chain are dropped, as
there is no software retry for non-aggregate frames. Patch 2
re-queues failed and filtered frames on tid->retry_q, as the
aggregate path does.
Toke, I know you were not keen on clearing the filter
unconditionally, so I first tested your suggestion (patch 2) alone.
On a weak link it did much worse than patch 1 alone, and the two
together did best. If you would prefer patch 1 limited, e.g. to
stations that are not sleeping, I can rework it.
Setup: TP-Link EAP225 v3 (QCA9563, 2.4 GHz), OpenWrt 25.12.5,
backports 6.18.26. ESP8266 clients running Tasmota, non-WMM, legacy
rates, modem sleep on (PS_STA toggling constantly).
Weak client (-75 dBm), ping -s 1000 -i 0.05, 500 pings per run:
loss TXERR Filtered avg RTT
patch 2 only 52-80% +544 per run 0.6-1.4 s
patch 1 only 0-1 pings 0 13 ms
Same client, patches 1+2 plus a test-only module parameter to switch
the software retry at runtime, 12 alternating runs in 11 minutes:
lost tx failed
retry off (1) 127/3000 130
retry on (1+2) 1/3000 1
At 1 ping/s, 3 x 25 pings each: 5/75 lost with retry off, 0/75 on.
Other tests with patches 1+2:
- 500 pings to each of five ESP8266 clients: 0 lost
- client restarts during ping floods, OTA updates: no issues
- WMM/HT clients (ESP32, IP camera, tablet): no change
- 67 h soak: no warnings or resets, MemAvailable flat, ath9k
queues drain to 0, 3 TXERR Filtered in total
Felix, on the open question from the RFC: on the weak link, filtered
frames appeared together with XRETRY failures, but on the original
good-signal setup they appeared without any. Do you know what sets
the destination mask for an awake station?
Changes since RFC:
- Patch 1: code unchanged, commit message updated
- Patch 2: new, alternative 2 from the RFC (Toke)
RFC: https://lore.kernel.org/linux-wireless/20261003192957.761090-1-t.tonhauser@xxxxxxxx/
The driver analysis and write-up were done with help from an LLM.
Tests and measurements were done by me.
Tomas Tonhauser (2):
wifi: ath9k: clear destination mask for non-aggregate frames
wifi: ath9k: retry failed non-aggregate frames in software
drivers/net/wireless/ath/ath9k/xmit.c | 58 +++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 4 deletions(-)
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
--
2.34.1