Skip to contentSkip to conversation

wifi: mt76: reorder RX frames when WED does not handle RX

PATCH New Valentin Berezhnoy 1 participant 1 message Nov 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mt76: reorder RX frames when WED does not handle RX

mt76_rx_poll_complete() skips mt76_rx_aggr_reorder() whenever mtk_wed_device_active() is true. MT7622 WED v1 offloads TX only:
mtk_wed_get_rx_capa() is false, the RX rings stay with the host and mt7915 does not set up WED RX offload. So on MT7622 + MT7915 with mt7915e wed_enable=1, nothing reorders the frames of an RX Block Ack session.

Out-of-order frames then reach mt76_check_ccmp_pn() first, and those with a lower packet number are marked as replays. Since commit 1c5ed3eb68a9 ("wifi: mt76: free a replayed 802.3 frame with all its subframes") drops such 802.3 frames, 5 GHz uploads from a client fell from 814-840 Mbit/s to 378-593 Mbit/s, with 5031-7630 TCP retransmissions per run instead of 583-822. Debug counters marked 2171 single and 5661 A-MSDU 802.3 frames out of 228603.

Check mtk_wed_get_rx_capa() as well before bypassing the reordering. The bypass stays where WED handles RX (MT7986 WED v2 with WO, MT7988/MT7996 WED v3 with HWRRO), and the NPU path is unchanged. With this change, at most 16 single and no A-MSDU frames out of 757567 were marked, as with WED detached, and uploads reached 826-859 Mbit/s with 66-157 retransmissions per run.

Fixes 4f831d18d12d ("wifi: mt76: mt7915: enable WED RX support")
Assisted-by LLM

---
Measured on an MT7622 + MT7915 router with OpenWrt 25.12.

This patch was prepared with the help of an AI assistant and reviewed by the submitter.

 drivers/net/wireless/mediatek/mt76/mac80211.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mac80211.c +2 -1
index 33f2bd5..4e56de3 100644
@@ -1751,7 +1751,8 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
 
 	while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) {
 		mt76_check_sta(dev, skb);
-		if (mtk_wed_device_active(&dev->mmio.wed) ||
+		if ((mtk_wed_device_active(&dev->mmio.wed) &&
+		     mtk_wed_get_rx_capa(&dev->mmio.wed)) ||
 		    mt76_npu_device_active(dev))
 			__skb_queue_tail(&frames, skb);
 		else
Signature · 1 line
2.53.0