All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: check ATF flag in ieee80211_next_txq()
@ 2021-01-06  1:01 ` Ryder Lee
  0 siblings, 0 replies; 16+ messages in thread
From: Ryder Lee @ 2021-01-06  1:01 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen
  Cc: Felix Fietkau, Lorenzo Bianconi, Shayne Chen, linux-wireless,
	linux-mediatek, Ryder Lee

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@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-01-08  2:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06  1:01 [PATCH] mac80211: check ATF flag in ieee80211_next_txq() Ryder Lee
2021-01-06  1:01 ` Ryder Lee
2021-01-06 10:51 ` Toke Høiland-Jørgensen
2021-01-06 10:51   ` Toke Høiland-Jørgensen
2021-01-06 11:50   ` Ryder Lee
2021-01-06 11:50     ` Ryder Lee
2021-01-06 13:30   ` Felix Fietkau
2021-01-06 13:30     ` Felix Fietkau
2021-01-06 15:41     ` Toke Høiland-Jørgensen
2021-01-06 15:41       ` Toke Høiland-Jørgensen
2021-01-07  2:11       ` Ryder Lee
2021-01-07  2:11         ` Ryder Lee
2021-01-07 13:08         ` Toke Høiland-Jørgensen
2021-01-07 13:08           ` Toke Høiland-Jørgensen
2021-01-08  2:25           ` Ryder Lee
2021-01-08  2:25             ` Ryder Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.