diff options
author | Toke Høiland-Jørgensen <toke@toke.dk> | 2017-10-31 12:27:46 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-12-11 12:40:24 +0100 |
commit | b0d52ad821843a6c5badebd80feef9f871904fa6 (patch) | |
tree | 6962b03bd69935102294e2038ae615309091f3d4 /net/mac80211/rx.c | |
parent | e937b8da5a591f141fe41aa48a2e898df9888c95 (diff) |
mac80211: Add airtime account and scheduling to TXQs
This adds airtime accounting and scheduling to the mac80211 TXQ
scheduler. A new hardware flag, AIRTIME_ACCOUNTING, is added that
drivers can set if they support reporting airtime usage of
transmissions. When this flag is set, mac80211 will expect the actual
airtime usage to be reported in the tx_time and rx_time fields of the
respective status structs.
When airtime information is present, mac80211 will schedule TXQs
(through ieee80211_next_txq()) in a way that enforces airtime fairness
between active stations. This scheduling works the same way as the ath9k
in-driver airtime fairness scheduling.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b3cff69bfd66..808f41fb536a 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1630,6 +1630,14 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) if (ieee80211_vif_is_mesh(&rx->sdata->vif)) ieee80211_mps_rx_h_sta_process(sta, hdr); + /* airtime accounting */ + if (status->airtime) { + spin_lock_bh(&sta->lock); + sta->airtime_stats.rx_airtime += status->airtime; + sta->airtime_deficit -= status->airtime; + spin_unlock_bh(&sta->lock); + } + /* * Drop (qos-)data::nullfunc frames silently, since they * are used only to control station power saving mode. |