From: Cristian Papa <pcristian292@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,
linux-mediatek@lists.infradead.org
Subject: [RFC PATCH 1/2] wifi: mt76: let a driver hold a station's tx queues
Date: Wed, 23 Sep 2026 10:22:55 -0300 [thread overview]
Message-ID: <20260923132257.8729-2-pcristian292@gmail.com> (raw)
In-Reply-To: <20260923132257.8729-1-pcristian292@gmail.com>
Some drivers know how many frames a station has inside the hardware
better than AQL does. mt7603 completes a frame to mac80211 as soon as
DMA has copied it, so AQL releases its airtime right away while the
hardware may keep hundreds of frames for the station.
Add MT_WCID_FLAG_TX_HOLD. While it is set, the tx scheduler leaves the
station's queues alone, like it does for a station at the non-AQL limit,
and stops a burst that filled the hardware. The driver clears the flag
and schedules the queues again when the hardware has drained.
No functional change for drivers that do not set the flag.
Assisted-by: LLM
Signed-off-by: Cristian Papa <pcristian292@gmail.com>
---
drivers/net/wireless/mediatek/mt76/mt76.h | 1 +
drivers/net/wireless/mediatek/mt76/tx.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 62b41c8bb..d03e66c2a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -362,6 +362,7 @@ enum mt76_wcid_flags {
MT_WCID_FLAG_4ADDR,
MT_WCID_FLAG_HDR_TRANS,
MT_WCID_FLAG_TDLS_PEER,
+ MT_WCID_FLAG_TX_HOLD,
};
#define MT76_N_WCIDS 1088
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 3707ee19e..e16a380c6 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -534,6 +534,10 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
if (stop || mt76_txq_stopped(q))
break;
+ /* The previous frame may have filled the hardware. */
+ if (test_bit(MT_WCID_FLAG_TX_HOLD, &wcid->flags))
+ break;
+
skb = mt76_txq_dequeue(phy, mtxq);
if (!skb)
break;
@@ -605,6 +609,9 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
if (atomic_read(&wcid->non_aql_packets) >= MT_MAX_NON_AQL_PKT)
continue;
+ /* The driver schedules the queues again when it lifts the hold. */
+ if (test_bit(MT_WCID_FLAG_TX_HOLD, &wcid->flags))
+ continue;
if (dev->queue_ops->tx_cleanup &&
q->queued + 2 * MT_TXQ_FREE_THR >= q->ndesc) {
dev->queue_ops->tx_cleanup(dev, q, false);
--
2.47.3
next prev parent reply other threads:[~2026-09-23 13:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 13:22 [RFC PATCH 0/2] wifi: mt76: mt7603: bound the frames a station keeps in the hardware Cristian Papa
2026-09-23 13:22 ` Cristian Papa [this message]
2026-09-23 13:22 ` [RFC PATCH 2/2] " Cristian Papa
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=20260923132257.8729-2-pcristian292@gmail.com \
--to=pcristian292@gmail.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--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