1. 16 2月, 2022 2 次提交
    • N
      mac80211: fix forwarded mesh frames AC & queue selection · 859ae701
      Nicolas Escande 提交于
      There are two problems with the current code that have been highlighted
      with the AQL feature that is now enbaled by default.
      
      First problem is in ieee80211_rx_h_mesh_fwding(),
      ieee80211_select_queue_80211() is used on received packets to choose
      the sending AC queue of the forwarding packet although this function
      should only be called on TX packet (it uses ieee80211_tx_info).
      This ends with forwarded mesh packets been sent on unrelated random AC
      queue. To fix that, AC queue can directly be infered from skb->priority
      which has been extracted from QOS info (see ieee80211_parse_qos()).
      
      Second problem is the value of queue_mapping set on forwarded mesh
      frames via skb_set_queue_mapping() is not the AC of the packet but a
      hardware queue index. This may or may not work depending on AC to HW
      queue mapping which is driver specific.
      
      Both of these issues lead to improper AC selection while forwarding
      mesh packets but more importantly due to improper airtime accounting
      (which is done on a per STA, per AC basis) caused traffic stall with
      the introduction of AQL.
      
      Fixes: cf440128 ("mac80211: fix unnecessary frame drops in mesh fwding")
      Fixes: d3c1597b ("mac80211: fix forwarded mesh frame queue mapping")
      Co-developed-by: NRemi Pommarel <repk@triplefau.lt>
      Signed-off-by: NRemi Pommarel <repk@triplefau.lt>
      Signed-off-by: NNicolas Escande <nico.escande@gmail.com>
      Link: https://lore.kernel.org/r/20220214173214.368862-1-nico.escande@gmail.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      859ae701
    • D
      mac80211: fix EAPoL rekey fail in 802.3 rx path · 610d086d
      Deren Wu 提交于
      mac80211 set capability NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211
      to upper layer by default. That means we should pass EAPoL packets through
      nl80211 path only, and should not send the EAPoL skb to netdevice diretly.
      At the meanwhile, wpa_supplicant would not register sock to listen EAPoL
      skb on the netdevice.
      
      However, there is no control_port_protocol handler in mac80211 for 802.3 RX
      packets, mac80211 driver would pass up the EAPoL rekey frame to netdevice
      and wpa_supplicant would be never interactive with this kind of packets,
      if SUPPORTS_RX_DECAP_OFFLOAD is enabled. This causes STA always rekey fail
      if EAPoL frame go through 802.3 path.
      
      To avoid this problem, align the same process as 802.11 type to handle
      this frame before put it into network stack.
      
      This also addresses a potential security issue in 802.3 RX mode that was
      previously fixed in commit a8c4d76a ("mac80211: do not accept/forward
      invalid EAPOL frames").
      
      Cc: stable@vger.kernel.org # 5.12+
      Fixes: 80a915ec ("mac80211: add rx decapsulation offload support")
      Signed-off-by: NDeren Wu <deren.wu@mediatek.com>
      Link: https://lore.kernel.org/r/6889c9fced5859ebb088564035f84fd0fa792a49.1644680751.git.deren.wu@mediatek.com
      [fix typos, update comment and add note about security issue]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      610d086d
  2. 04 1月, 2022 1 次提交
  3. 20 12月, 2021 1 次提交
  4. 26 11月, 2021 1 次提交
    • X
      mac80211: set up the fwd_skb->dev for mesh forwarding · 942bd107
      Xing Song 提交于
      Mesh forwarding requires that the fwd_skb->dev is set up for TX handling,
      otherwise the following warning will be generated, so set it up for the
      pending frames.
      
      [   72.835674 ] WARNING: CPU: 0 PID: 1193 at __skb_flow_dissect+0x284/0x1298
      [   72.842379 ] Modules linked in: ksmbd pppoe ppp_async l2tp_ppp ...
      [   72.962020 ] CPU: 0 PID: 1193 Comm: kworker/u5:1 Tainted: P S 5.4.137 #0
      [   72.969938 ] Hardware name: MT7622_MT7531 RFB (DT)
      [   72.974659 ] Workqueue: napi_workq napi_workfn
      [   72.979025 ] pstate: 60000005 (nZCv daif -PAN -UAO)
      [   72.983822 ] pc : __skb_flow_dissect+0x284/0x1298
      [   72.988444 ] lr : __skb_flow_dissect+0x54/0x1298
      [   72.992977 ] sp : ffffffc010c738c0
      [   72.996293 ] x29: ffffffc010c738c0 x28: 0000000000000000
      [   73.001615 ] x27: 000000000000ffc2 x26: ffffff800c2eb818
      [   73.006937 ] x25: ffffffc010a987c8 x24: 00000000000000ce
      [   73.012259 ] x23: ffffffc010c73a28 x22: ffffffc010a99c60
      [   73.017581 ] x21: 000000000000ffc2 x20: ffffff80094da800
      [   73.022903 ] x19: 0000000000000000 x18: 0000000000000014
      [   73.028226 ] x17: 00000000084d16af x16: 00000000d1fc0bab
      [   73.033548 ] x15: 00000000715f6034 x14: 000000009dbdd301
      [   73.038870 ] x13: 00000000ea4dcbc3 x12: 0000000000000040
      [   73.044192 ] x11: 000000000eb00ff0 x10: 0000000000000000
      [   73.049513 ] x9 : 000000000eb00073 x8 : 0000000000000088
      [   73.054834 ] x7 : 0000000000000000 x6 : 0000000000000001
      [   73.060155 ] x5 : 0000000000000000 x4 : 0000000000000000
      [   73.065476 ] x3 : ffffffc010a98000 x2 : 0000000000000000
      [   73.070797 ] x1 : 0000000000000000 x0 : 0000000000000000
      [   73.076120 ] Call trace:
      [   73.078572 ]  __skb_flow_dissect+0x284/0x1298
      [   73.082846 ]  __skb_get_hash+0x7c/0x228
      [   73.086629 ]  ieee80211_txq_may_transmit+0x7fc/0x17b8 [mac80211]
      [   73.092564 ]  ieee80211_tx_prepare_skb+0x20c/0x268 [mac80211]
      [   73.098238 ]  ieee80211_tx_pending+0x144/0x330 [mac80211]
      [   73.103560 ]  tasklet_action_common.isra.16+0xb4/0x158
      [   73.108618 ]  tasklet_action+0x2c/0x38
      [   73.112286 ]  __do_softirq+0x168/0x3b0
      [   73.115954 ]  do_softirq.part.15+0x88/0x98
      [   73.119969 ]  __local_bh_enable_ip+0xb0/0xb8
      [   73.124156 ]  napi_workfn+0x58/0x90
      [   73.127565 ]  process_one_work+0x20c/0x478
      [   73.131579 ]  worker_thread+0x50/0x4f0
      [   73.135249 ]  kthread+0x124/0x128
      [   73.138484 ]  ret_from_fork+0x10/0x1c
      Signed-off-by: NXing Song <xing.song@mediatek.com>
      Tested-By: NFrank Wunderlich <frank-w@public-files.de>
      Link: https://lore.kernel.org/r/20211123033123.2684-1-xing.song@mediatek.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      942bd107
  5. 15 11月, 2021 3 次提交
  6. 23 9月, 2021 2 次提交
  7. 24 8月, 2021 1 次提交
  8. 13 8月, 2021 2 次提交
  9. 23 7月, 2021 1 次提交
    • J
      mac80211: Do not strip skb headroom on monitor frames · ec61cd49
      Johan Almbladh 提交于
      When a monitor interface is present together with other interfaces, a
      received skb is copied and received on the monitor netdev. Before, the
      copied skb was allocated with exactly the amount of space needed for
      the radiotap header, resulting in an skb without any headroom at all
      being received on the monitor netdev. With the introduction of eBPF
      and XDP in the kernel, skbs may be processed by custom eBPF programs.
      However, since the skb cannot be reallocated in the eBPF program, no
      more data or headers can be pushed. The old code made sure the final
      headroom was zero regardless of the value of NET_SKB_PAD, so increasing
      that constant would have no effect.
      
      Now we allocate monitor skb copies with a headroom of NET_SKB_PAD bytes
      before the radiotap header. Monitor interfaces now behave in the same
      way as other netdev interfaces that honor the NET_SKB_PAD constant.
      Signed-off-by: NJohan Almbladh <johan.almbladh@anyfinetworks.com>
      Link: https://lore.kernel.org/r/20210628123713.2070753-1-johan.almbladh@anyfinetworks.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      ec61cd49
  10. 24 6月, 2021 1 次提交
    • T
      mac80211: Switch to a virtual time-based airtime scheduler · 2433647b
      Toke Høiland-Jørgensen 提交于
      This switches the airtime scheduler in mac80211 to use a virtual
      time-based scheduler instead of the round-robin scheduler used before.
      This has a couple of advantages:
      
      - No need to sync up the round-robin scheduler in firmware/hardware with
        the round-robin airtime scheduler.
      
      - If several stations are eligible for transmission we can schedule both
        of them; no need to hard-block the scheduling rotation until the head
        of the queue has used up its quantum.
      
      - The check of whether a station is eligible for transmission becomes
        simpler (in ieee80211_txq_may_transmit()).
      
      The drawback is that scheduling becomes slightly more expensive, as we
      need to maintain an rbtree of TXQs sorted by virtual time. This means
      that ieee80211_register_airtime() becomes O(logN) in the number of
      currently scheduled TXQs because it can change the order of the
      scheduled stations. We mitigate this overhead by only resorting when a
      station changes position in the tree, and hopefully N rarely grows too
      big (it's only TXQs currently backlogged, not all associated stations),
      so it shouldn't be too big of an issue.
      
      To prevent divisions in the fast path, we maintain both station sums and
      pre-computed reciprocals of the sums. This turns the fast-path operation
      into a multiplication, with divisions only happening as the number of
      active stations change (to re-compute the current sum of all active
      station weights). To prevent this re-computation of the reciprocal from
      happening too frequently, we use a time-based notion of station
      activity, instead of updating the weight every time a station gets
      scheduled or de-scheduled. As queues can oscillate between empty and
      occupied quite frequently, this can significantly cut down on the number
      of re-computations. It also has the added benefit of making the station
      airtime calculation independent on whether the queue happened to have
      drained at the time an airtime value was accounted.
      Co-developed-by: NYibo Zhao <yiboz@codeaurora.org>
      Signed-off-by: NYibo Zhao <yiboz@codeaurora.org>
      Signed-off-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Link: https://lore.kernel.org/r/20210623134755.235545-1-toke@redhat.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      2433647b
  11. 23 6月, 2021 2 次提交
  12. 09 6月, 2021 1 次提交
  13. 12 5月, 2021 9 次提交
  14. 06 3月, 2021 1 次提交
  15. 21 1月, 2021 1 次提交
    • F
      mac80211: add rx decapsulation offload support · 80a915ec
      Felix Fietkau 提交于
      This allows drivers to pass 802.3 frames to mac80211, with some restrictions:
      
      - the skb must be passed with a valid sta
      - fast-rx needs to be active for the sta
      - monitor mode needs to be disabled
      
      mac80211 will tell the driver when it is safe to enable rx decap offload for
      a particular station.
      
      In order to implement support, a driver must:
      
      - call ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD)
      - implement ops->sta_set_decap_offload
      - mark 802.3 frames with RX_FLAG_8023
      
      If it doesn't want to enable offload for some vif types, it can mask out
      IEEE80211_OFFLOAD_DECAP_ENABLED in vif->offload_flags from within the
      .add_interface or .update_vif_offload driver ops
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Link: https://lore.kernel.org/r/20201218184718.93650-6-nbd@nbd.nameSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      80a915ec
  16. 15 1月, 2021 1 次提交
  17. 11 12月, 2020 2 次提交
  18. 11 11月, 2020 1 次提交
  19. 03 11月, 2020 1 次提交
  20. 28 9月, 2020 2 次提交
  21. 18 9月, 2020 3 次提交
  22. 31 7月, 2020 1 次提交