Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Berezhnoy <dreyksmail@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com,
	shayne.chen@mediatek.com, sean.wang@mediatek.com,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Valentin Berezhnoy <dreyksmail@gmail.com>
Subject: [PATCH mt76] wifi: mt76: reorder RX frames when WED does not handle RX
Date: Sat, 28 Nov 2026 13:50:48 +0200	[thread overview]
Message-ID: <20261128115048.84165-1-dreyksmail@gmail.com> (raw)

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
Signed-off-by: Valentin Berezhnoy <dreyksmail@gmail.com>
---
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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 33f2bd5..4e56de3 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -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
-- 
2.53.0



                 reply	other threads:[~2026-11-28 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261128115048.84165-1-dreyksmail@gmail.com \
    --to=dreyksmail@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox