wifi: mac80211: make sta airtime deficit field s32 instead of s64
authorFelix Fietkau <nbd@nbd.name>
Sat, 25 Jun 2022 21:24:06 +0000 (23:24 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 1 Jul 2022 08:51:48 +0000 (10:51 +0200)
32 bit is more than enough range for the airtime deficit

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://lore.kernel.org/r/20220625212411.36675-2-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/debugfs_sta.c
net/mac80211/sta_info.h
net/mac80211/tx.c

index 1dc238f..d3397c1 100644 (file)
@@ -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]);
 
index 3e26ad3..44ebf17 100644 (file)
@@ -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;
index fcee60c..a615cad 100644 (file)
@@ -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;