[PATCH] mac80211: check ATF flag in ieee80211_next_txq()

Ryder Lee ryder.lee at mediatek.com
Tue Jan 5 20:01:49 EST 2021


The selected txq should be scheduled unconditionally if
NL80211_EXT_FEATURE_AIRTIME_FAIRNESS is not set by driver.

Also put the sta to the end of the active_txqs list if
deficit is negative then move on to the next txq.

Tested-by: Sujuan Chen <sujuan.chen at mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
---
 net/mac80211/tx.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6422da6690f7..5640c9428596 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3760,14 +3760,19 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
 		struct sta_info *sta = container_of(txqi->txq.sta,
 						    struct sta_info, sta);
 		bool aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq);
-		s64 deficit = sta->airtime[txqi->txq.ac].deficit;
+		s64 deficit = 0;
 
 		if (aql_check)
 			found_eligible_txq = true;
 
-		if (deficit < 0)
-			sta->airtime[txqi->txq.ac].deficit +=
-				sta->airtime_weight;
+		if (wiphy_ext_feature_isset(local->hw.wiphy,
+					    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) {
+			deficit = sta->airtime[txqi->txq.ac].deficit;
+
+			if (deficit < 0)
+				sta->airtime[txqi->txq.ac].deficit +=
+					sta->airtime_weight;
+		}
 
 		if (deficit < 0 || !aql_check) {
 			list_move_tail(&txqi->schedule_order,
-- 
2.18.0


More information about the Linux-mediatek mailing list