linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: toke@kernel.org, johannes@sipsolutions.net
Subject: [PATCH 2/7] mac80211: make sta airtime deficit field s32 instead of s64
Date: Sat, 25 Jun 2022 23:24:06 +0200	[thread overview]
Message-ID: <20220625212411.36675-2-nbd@nbd.name> (raw)
In-Reply-To: <20220625212411.36675-1-nbd@nbd.name>

32 bit is more than enough range for the airtime deficit

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/debugfs_sta.c | 4 ++--
 net/mac80211/sta_info.h    | 2 +-
 net/mac80211/tx.c          | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 1dc238fc24f0..d3397c1248d3 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -202,7 +202,7 @@ static ssize_t sta_airtime_read(struct file *file, char __user *userbuf,
 	size_t bufsz = 400;
 	char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf;
 	u64 rx_airtime = 0, tx_airtime = 0;
-	s64 deficit[IEEE80211_NUM_ACS];
+	s32 deficit[IEEE80211_NUM_ACS];
 	ssize_t rv;
 	int ac;
 
@@ -219,7 +219,7 @@ static ssize_t sta_airtime_read(struct file *file, char __user *userbuf,
 
 	p += scnprintf(p, bufsz + buf - p,
 		"RX: %llu us\nTX: %llu us\nWeight: %u\n"
-		"Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n",
+		"Deficit: VO: %d us VI: %d us BE: %d us BK: %d us\n",
 		rx_airtime, tx_airtime, sta->airtime_weight,
 		deficit[0], deficit[1], deficit[2], deficit[3]);
 
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 4ba0c252da95..785fefe8c41a 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -138,7 +138,7 @@ enum ieee80211_agg_stop_reason {
 struct airtime_info {
 	u64 rx_airtime;
 	u64 tx_airtime;
-	s64 deficit;
+	s32 deficit;
 	atomic_t aql_tx_pending; /* Estimated airtime for frames pending */
 	u32 aql_limit_low;
 	u32 aql_limit_high;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index fcee60ce2456..a615cadf7728 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3830,7 +3830,7 @@ 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;
+		s32 deficit = sta->airtime[txqi->txq.ac].deficit;
 
 		if (aql_check)
 			found_eligible_txq = true;
-- 
2.36.1


  reply	other threads:[~2022-06-25 21:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25 21:24 [PATCH 1/7] mac80211: switch airtime fairness back to deficit round-robin scheduling Felix Fietkau
2022-06-25 21:24 ` Felix Fietkau [this message]
2022-06-27 15:02   ` [PATCH 2/7] mac80211: make sta airtime deficit field s32 instead of s64 Toke Høiland-Jørgensen
2022-06-25 21:24 ` [PATCH 3/7] mac80211: consider aql_tx_pending when checking airtime deficit Felix Fietkau
2022-06-27 15:02   ` Toke Høiland-Jørgensen
2022-06-25 21:24 ` [PATCH 4/7] mac80211: keep recently active tx queues in scheduling list Felix Fietkau
2022-06-27 15:03   ` Toke Høiland-Jørgensen
2022-06-25 21:24 ` [PATCH 5/7] mac80211: add a per-PHY AQL limit to improve fairness Felix Fietkau
2022-06-27 15:04   ` Toke Høiland-Jørgensen
2022-06-25 21:24 ` [PATCH 6/7] mac80211: add debugfs file to display per-phy AQL pending airtime Felix Fietkau
2022-06-27 15:04   ` Toke Høiland-Jørgensen
2022-06-25 21:24 ` [PATCH 7/7] mac80211: only accumulate airtime deficit for active clients Felix Fietkau
2022-06-27 15:04   ` Toke Høiland-Jørgensen
2022-06-27 15:02 ` [PATCH 1/7] mac80211: switch airtime fairness back to deficit round-robin scheduling Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220625212411.36675-2-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=toke@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).