OSDN Git Service

mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 19 Nov 2019 06:06:10 +0000 (22:06 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 22 Nov 2019 12:36:25 +0000 (13:36 +0100)
commit7a89233ac50468a3a9636803a85d06c8f907f8ee
tree02639ea6fe379fb1795bd34f1eb64ac51989d91c
parent3ace10f5b5ad94bdbd4b419dc9da2217d57720a9
mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue

The previous commit added the ability to throttle stations when they queue
too much airtime in the hardware. This commit enables the functionality by
calculating the expected airtime usage of each packet that is dequeued from
the TXQs in mac80211, and accounting that as pending airtime.

The estimated airtime for each skb is stored in the tx_info, so we can
subtract the same amount from the running total when the skb is freed or
recycled. The throttling mechanism relies on this accounting to be
accurate (i.e., that we are not freeing skbs without subtracting any
airtime they were accounted for), so we put the subtraction into
ieee80211_report_used_skb(). As an optimisation, we also subtract the
airtime on regular TX completion, zeroing out the value stored in the
packet afterwards, to avoid having to do an expensive lookup of the station
from the packet data on every packet.

This patch does *not* include any mechanism to wake a throttled TXQ again,
on the assumption that this will happen anyway as a side effect of whatever
freed the skb (most commonly a TX completion).

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20191119060610.76681-5-kyan@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/status.c
net/mac80211/tx.c