From: Zichao-xu 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)