Skip to contentSkip to conversation

wifi: mt76: mt7996: refresh the tx BA session timer on NPU devices

PATCH In review Gilly1970 2 participants 2 messages Sep 18 – Sep 19

Subsystems (2)
lore
Share & tools
lore

Gilly1970

author
#0 lore raw

PATCH 1/1 wifi: mt76: mt7996: refresh the tx BA session timer on NPU devices

From: Chris Scott <[email protected]>

mt7996_mac_add_txs_skb() refreshes mac80211's tx BlockAck session timer only when a WED device is active. Airoha boards offload through the NPU instead, so on those the condition is never true and nothing keeps the timer alive.

NPU-forwarded frames do not traverse mac80211, and the only other places that stamp tid_tx->last_tx are in the software tx path. When the peer negotiates a non-zero BlockAck timeout in the ADDBA response (Intel stations commonly do, most others answer 0) mac80211 arms tid_tx->session_timer, which then expires in the middle of an offloaded transfer and tears the session down with a DELBA.

The session does not come back on its own either: mt7996 restarts one from mt7996_tx_check_aggr(), reached via mt7996_txwi_free(), and offloaded frames carry no driver token so they never get there. mac80211's ieee80211_aggr_check() fallback needs RATE_CTRL_CAPA_AMPDU_TRIGGER, which mt7996 does not set. The reported symptom is a file transfer to an Intel client dropping from line rate to a few MB/s and staying there, with a single ping from the router - one frame on the software path - restoring it instantly.

Extend the check with mt76_npu_device_active(). TXS reports do arrive for NPU-forwarded frames, measured at roughly 24 per second on a busy radio, which is far more than a seconds-scale session timer needs.

A second user who independently saw the same collapse, held off only by a once-a-second ping from the AP, ran a patched image for 100 hours (~175 TB of offloaded iperf3 traffic, ~4 Gbit/s) without it recurring.

---
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mac.c +2 -1
index dc1a3e9..e50db1f 100644
@@ -1540,7 +1540,8 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,
 		}
 	}
 
-	if (mtk_wed_device_active(&dev->mt76.mmio.wed) && wcid->sta) {
+	if ((mtk_wed_device_active(&dev->mt76.mmio.wed) ||
+	     mt76_npu_device_active(&dev->mt76)) && wcid->sta) {
 		struct ieee80211_sta *sta;
 		u8 tid;
 
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines

From: Chris Scott <[email protected]>

mt7996_mac_add_txs_skb() refreshes mac80211's tx BlockAck session timer only when a WED device is active. Airoha boards offload through the NPU instead, so on those the condition is never true and nothing keeps the timer alive.

NPU-forwarded frames do not traverse mac80211, and the only other places that stamp tid_tx->last_tx are in the software tx path. When the peer negotiates a non-zero BlockAck timeout in the ADDBA response (Intel stations commonly do, most others answer 0) mac80211 arms tid_tx->session_timer, which then expires in the middle of an offloaded transfer and tears the session down with a DELBA.

The session does not come back on its own either: mt7996 restarts one from mt7996_tx_check_aggr(), reached via mt7996_txwi_free(), and offloaded frames carry no driver token so they never get there. mac80211's ieee80211_aggr_check() fallback needs RATE_CTRL_CAPA_AMPDU_TRIGGER, which mt7996 does not set. The reported symptom is a file transfer to an Intel client dropping from line rate to a few MB/s and staying there, with a single ping from the router - one frame on the software path - restoring it instantly.

Extend the check with mt76_npu_device_active(). TXS reports do arrive for NPU-forwarded frames, measured at roughly 24 per second on a busy radio, which is far more than a seconds-scale session timer needs.

A second user who independently saw the same collapse, held off only by a once-a-second ping from the AP, ran a patched image for 100 hours (~175 TB of offloaded iperf3 traffic, ~4 Gbit/s) without it recurring.

Quoted 5 lines
Quoted 21 lines
---
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mac.c +2 -1
index dc1a3e9..e50db1f 100644
@@ -1540,7 +1540,8 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,
 		}
 	}
 
-	if (mtk_wed_device_active(&dev->mt76.mmio.wed) && wcid->sta) {
+	if ((mtk_wed_device_active(&dev->mt76.mmio.wed) ||
+	     mt76_npu_device_active(&dev->mt76)) && wcid->sta) {
 		struct ieee80211_sta *sta;
 		u8 tid;
 
Signature · 1 line
2.43.0