1. 07 2月, 2020 1 次提交
  2. 22 11月, 2019 3 次提交
    • T
      mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue · 7a89233a
      Toke Høiland-Jørgensen 提交于
      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: NToke Høiland-Jørgensen <toke@redhat.com>
      Link: https://lore.kernel.org/r/20191119060610.76681-5-kyan@google.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      7a89233a
    • K
      mac80211: Implement Airtime-based Queue Limit (AQL) · 3ace10f5
      Kan Yan 提交于
      In order for the Fq_CoDel algorithm integrated in mac80211 layer to operate
      effectively to control excessive queueing latency, the CoDel algorithm
      requires an accurate measure of how long packets stays in the queue, AKA
      sojourn time. The sojourn time measured at the mac80211 layer doesn't
      include queueing latency in the lower layer (firmware/hardware) and CoDel
      expects lower layer to have a short queue. However, most 802.11ac chipsets
      offload tasks such TX aggregation to firmware or hardware, thus have a deep
      lower layer queue.
      
      Without a mechanism to control the lower layer queue size, packets only
      stay in mac80211 layer transiently before being sent to firmware queue.
      As a result, the sojourn time measured by CoDel in the mac80211 layer is
      almost always lower than the CoDel latency target, hence CoDel does little
      to control the latency, even when the lower layer queue causes excessive
      latency.
      
      The Byte Queue Limits (BQL) mechanism is commonly used to address the
      similar issue with wired network interface. However, this method cannot be
      applied directly to the wireless network interface. "Bytes" is not a
      suitable measure of queue depth in the wireless network, as the data rate
      can vary dramatically from station to station in the same network, from a
      few Mbps to over Gbps.
      
      This patch implements an Airtime-based Queue Limit (AQL) to make CoDel work
      effectively with wireless drivers that utilized firmware/hardware
      offloading. AQL allows each txq to release just enough packets to the lower
      layer to form 1-2 large aggregations to keep hardware fully utilized and
      retains the rest of the frames in mac80211 layer to be controlled by the
      CoDel algorithm.
      Signed-off-by: NKan Yan <kyan@google.com>
      [ Toke: Keep API to set pending airtime internal, fix nits in commit msg ]
      Signed-off-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Link: https://lore.kernel.org/r/20191119060610.76681-4-kyan@google.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      3ace10f5
    • T
      mac80211: Import airtime calculation code from mt76 · db3e1c40
      Toke Høiland-Jørgensen 提交于
      Felix recently added code to calculate airtime of packets to the mt76
      driver. Import this into mac80211 so we can use it for airtime queue limit
      calculations.
      
      The airtime.c file is copied verbatim from the mt76 driver, and adjusted to
      be usable in mac80211. This involves:
      
      - Switching to mac80211 data structures.
      - Adding support for 160 MHz channels and HE mode.
      - Moving the symbol and duration calculations around a bit to avoid
        rounding with the higher rates and longer symbol times used for HE rates.
      
      The per-rate TX rate calculation is also split out to its own function so
      it can be used directly for the AQL calculations later.
      Signed-off-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Link: https://lore.kernel.org/r/20191119060610.76681-3-kyan@google.com
      [fix HE_GROUP_IDX() to use 3 * bw, since there are 3 _gi values]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      db3e1c40
  3. 08 11月, 2019 1 次提交
  4. 28 10月, 2019 2 次提交
  5. 04 10月, 2019 1 次提交
  6. 11 9月, 2019 1 次提交
  7. 31 7月, 2019 1 次提交
  8. 29 7月, 2019 1 次提交
  9. 26 7月, 2019 7 次提交
  10. 19 6月, 2019 1 次提交
  11. 14 6月, 2019 4 次提交
  12. 26 4月, 2019 3 次提交
  13. 08 4月, 2019 1 次提交
    • F
      mac80211: make ieee80211_schedule_txq schedule empty TXQs · 2b4a6698
      Felix Fietkau 提交于
      Currently there is no way for the driver to signal to mac80211 that it should
      schedule a TXQ even if there are no packets on the mac80211 part of that queue.
      This is problematic if the driver has an internal retry queue to deal with
      software A-MPDU retry.
      
      This patch changes the behavior of ieee80211_schedule_txq to always schedule
      the queue, as its only user (ath9k) seems to expect such behavior already:
      it calls this function on tx status and on powersave wakeup whenever its
      internal retry queue is not empty.
      
      Also add an extra argument to ieee80211_return_txq to get the same behavior.
      
      This fixes an issue on ath9k where tx queues with packets to retry (and no
      new packets in mac80211) would not get serviced.
      
      Fixes: 89cea749 ("ath9k: Switch to mac80211 TXQ scheduling and airtime APIs")
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Acked-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2b4a6698
  14. 29 3月, 2019 1 次提交
  15. 22 2月, 2019 3 次提交
  16. 08 2月, 2019 2 次提交
  17. 01 2月, 2019 2 次提交
  18. 25 1月, 2019 1 次提交
  19. 19 1月, 2019 3 次提交
    • F
      mac80211: minstrel_ht: add flag to indicate missing/inaccurate tx A-MPDU length · 77f7ffdc
      Felix Fietkau 提交于
      Some hardware (e.g. MediaTek MT7603) cannot report A-MPDU length in tx status
      information. Add support for a flag to indicate that, to allow minstrel_ht
      to use a fixed value in its internal calculation (which gives better results
      than just defaulting to 1).
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      77f7ffdc
    • T
      mac80211: Add airtime accounting and scheduling to TXQs · b4809e94
      Toke Høiland-Jørgensen 提交于
      This adds airtime accounting and scheduling to the mac80211 TXQ
      scheduler. A new callback, ieee80211_sta_register_airtime(), is added
      that drivers can call to report airtime usage for stations.
      
      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. If no airtime usage is reported
      by the driver, the scheduler will default to round-robin scheduling.
      
      For drivers that don't control TXQ scheduling in software, a new API
      function, ieee80211_txq_may_transmit(), is added which the driver can use
      to check if the TXQ is eligible for transmission, or should be throttled to
      enforce fairness. Calls to this function must also be enclosed in
      ieee80211_txq_schedule_{start,end}() calls to ensure proper locking.
      
      The API ieee80211_txq_may_transmit() also ensures that TXQ list will be
      aligned aginst driver's own round-robin scheduler list. i.e it rotates
      the TXQ list till it makes the requested node becomes the first entry
      in TXQ list. Thus both the TXQ list and driver's list are in sync.
      Co-developed-by: NRajkumar Manoharan <rmanohar@codeaurora.org>
      Signed-off-by: NLouie Lu <git@louie.lu>
      [added debugfs write op to reset airtime counter]
      Signed-off-by: NToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: NRajkumar Manoharan <rmanohar@codeaurora.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      b4809e94
    • T
      mac80211: Add TXQ scheduling API · 18667600
      Toke Høiland-Jørgensen 提交于
      This adds an API to mac80211 to handle scheduling of TXQs. The interface
      between driver and mac80211 for TXQ handling is changed by adding two new
      functions: ieee80211_next_txq(), which will return the next TXQ to schedule
      in the current round-robin rotation, and ieee80211_return_txq(), which the
      driver uses to indicate that it has finished scheduling a TXQ (which will
      then be put back in the scheduling rotation if it isn't empty).
      
      The driver must call ieee80211_txq_schedule_start() at the start of each
      scheduling session, and ieee80211_txq_schedule_end() at the end. The API
      then guarantees that the same TXQ is not returned twice in the same
      session (so a driver can loop on ieee80211_next_txq() without worrying
      about breaking the loop.
      
      Usage of the new API is optional, so drivers can be ported one at a time.
      In this patch, the actual scheduling performed by mac80211 is simple
      round-robin, but a subsequent commit adds airtime fairness awareness to the
      scheduler.
      Signed-off-by: NToke Høiland-Jørgensen <toke@toke.dk>
      [minor kernel-doc fix, propagate sparse locking checks out]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      18667600
  20. 18 12月, 2018 1 次提交