1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 20 Jun 2022 14:53:04 +0200
3 Subject: [PATCH] mac80211: make sta airtime deficit field s32 instead of
6 32 bit is more than enough range for the airtime deficit
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/debugfs_sta.c
12 +++ b/net/mac80211/debugfs_sta.c
13 @@ -202,7 +202,7 @@ static ssize_t sta_airtime_read(struct f
15 char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf;
16 u64 rx_airtime = 0, tx_airtime = 0;
17 - s64 deficit[IEEE80211_NUM_ACS];
18 + s32 deficit[IEEE80211_NUM_ACS];
22 @@ -219,7 +219,7 @@ static ssize_t sta_airtime_read(struct f
24 p += scnprintf(p, bufsz + buf - p,
25 "RX: %llu us\nTX: %llu us\nWeight: %u\n"
26 - "Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n",
27 + "Deficit: VO: %d us VI: %d us BE: %d us BK: %d us\n",
28 rx_airtime, tx_airtime, sta->airtime_weight,
29 deficit[0], deficit[1], deficit[2], deficit[3]);
31 --- a/net/mac80211/sta_info.h
32 +++ b/net/mac80211/sta_info.h
33 @@ -138,7 +138,7 @@ enum ieee80211_agg_stop_reason {
39 atomic_t aql_tx_pending; /* Estimated airtime for frames pending */
42 --- a/net/mac80211/tx.c
43 +++ b/net/mac80211/tx.c
44 @@ -3847,7 +3847,7 @@ struct ieee80211_txq *ieee80211_next_txq
45 struct sta_info *sta = container_of(txqi->txq.sta,
46 struct sta_info, sta);
47 bool aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq);
48 - s64 deficit = sta->airtime[txqi->txq.ac].deficit;
49 + s32 deficit = sta->airtime[txqi->txq.ac].deficit;
52 found_eligible_txq = true;