[openwrt/openwrt] mac80211: fix a regression in the broadcast AQL patch

LEDE Commits lede-commits at lists.infradead.org
Fri Mar 8 13:46:42 PST 2024


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/1f5fd5cb971166ba57996d41b7ce71e697c186b2

commit 1f5fd5cb971166ba57996d41b7ce71e697c186b2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Mar 8 22:42:50 2024 +0100

    mac80211: fix a regression in the broadcast AQL patch
    
    The AQL limit for buffered broadcast packets is higher than the maximum
    total pending airtime limit. This can get unicast data stuck whenever there
    is too much pending broadcast data. Fix this by excluding broadcast AQL from
    the total limit.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...211-add-AQL-support-for-broadcast-packets.patch | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch
index 6f64467b66..f117a68c16 100644
--- a/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch
+++ b/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch
@@ -95,12 +95,13 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		spin_lock_init(&local->active_txq_lock[i]);
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -2341,28 +2341,27 @@ void ieee80211_sta_update_pending_airtim
+@@ -2341,29 +2341,33 @@ void ieee80211_sta_update_pending_airtim
  					  struct sta_info *sta, u8 ac,
  					  u16 tx_airtime, bool tx_completed)
  {
+-	int tx_pending;
++	int tx_pending = 0;
 +	atomic_t *counter;
- 	int tx_pending;
  
  	if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL))
  		return;
@@ -113,9 +114,18 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +		counter = &sta->airtime[ac].aql_tx_pending;
 +	else
 +		counter = &local->aql_bc_pending_airtime;
++
++	if (!tx_completed)
++		atomic_add(tx_airtime, counter);
++	else
++		tx_pending = atomic_sub_return(tx_airtime, counter);
++	if (tx_pending < 0)
++		atomic_cmpxchg(counter, tx_pending, 0);
++
++	if (!sta)
++		return;
  
 +	if (!tx_completed) {
-+		atomic_add(tx_airtime, counter);
  		atomic_add(tx_airtime, &local->aql_total_pending_airtime);
  		atomic_add(tx_airtime, &local->aql_ac_pending_airtime[ac]);
  		return;
@@ -128,12 +138,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -			atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending,
 -				       tx_pending, 0);
 -	}
-+	tx_pending = atomic_sub_return(tx_airtime, counter);
-+	if (tx_pending < 0)
-+		atomic_cmpxchg(counter, tx_pending, 0);
- 
+-
  	atomic_sub(tx_airtime, &local->aql_total_pending_airtime);
  	tx_pending = atomic_sub_return(tx_airtime,
+ 				       &local->aql_ac_pending_airtime[ac]);
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
 @@ -3958,9 +3958,8 @@ begin:




More information about the lede-commits mailing list