From: Zichao-xu Date: Wed, 02 Dec 2026 16:52:34 +0900 Subject: [PATCH RFC 1/3] wifi: mt76: limit non-AQL frames queued for a sleeping station MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-rfc-v1-1-eff86f0bf9e6@gmail.com> References: <20261202-rfc-v1-0-eff86f0bf9e6@gmail.com> In-Reply-To: <20261202-rfc-v1-0-eff86f0bf9e6@gmail.com> To: linux-wireless@vger.kernel.org Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , linux-mediatek@lists.infradead.org, Zichao-xu X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796197954; l=1996; i=xvzichao2333@gmail.com; s=20261202; h=from:subject:message-id; bh=wApTSm7XSBtPKgsqjtlDgTbl70TEEgBQlqEJYDE8iI8=; b=7A0VZbL9HDkoikV0MBYT0nc4XQEkoXH/0TbLBy09zag6TzMh+BD+augP9cSpQ8gNzMiy6CtRk 6eu13cSvw+oC658au4MiKJK5JB9mpt9NBrZ/UmyzVvYdFFDlPG8uZB6 X-Developer-Key: i=xvzichao2333@gmail.com; a=ed25519; pk=4y2PCqVVaZTmU/wzky/gd6WColWnjFznkFN8fXd+GMI= X-Endpoint-Received: by B4 Relay for xvzichao2333@gmail.com/20261202 with auth_id=1717 List-Id: B4 Relay Submissions Frames without an airtime estimate, such as those of an MLO station, get past the AQL check in mt76_txq_send_burst() while the station is in power save. They stay in the firmware until the station wakes up and count against MT_MAX_NON_AQL_PKT meanwhile. That limit is shared by all links of an MLO station, so frames parked on a link the station dozes on can use it up and stop TX to the station on its other links as well. Only queue up to MT_MAX_PS_NON_AQL_PKT (4) such frames while the station is in power save. Signed-off-by: Zichao-xu --- drivers/net/wireless/mediatek/mt76/mt76.h | 1 + drivers/net/wireless/mediatek/mt76/tx.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 21a04b8..455f0f1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -30,6 +30,7 @@ #define MT_SKB_HEAD_LEN 256 #define MT_MAX_NON_AQL_PKT 16 +#define MT_MAX_PS_NON_AQL_PKT 4 #define MT_TXQ_FREE_THR 32 #define MT76_TOKEN_FREE_THR 64 diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index bd5ad68..7446cdb 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -550,6 +550,15 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q, return 0; if (ieee80211_txq_aql_pending(phy->hw, txq)) return 0; + /* + * Frames without an airtime estimate (e.g. those of an MLO + * peer) get past the AQL check above. They stay in the + * firmware until the peer wakes up and count against the + * non-AQL limit of the peer meanwhile, so only park a few. + */ + if (atomic_read(&mt76_wcid_primary(wcid)->non_aql_packets) >= + MT_MAX_PS_NON_AQL_PKT) + return 0; } if (atomic_read(&mt76_wcid_primary(wcid)->non_aql_packets) >= -- Git-157)