1. 24 4月, 2015 2 次提交
  2. 23 4月, 2015 1 次提交
  3. 22 4月, 2015 7 次提交
    • J
      mac80211: allow segmentation offloads · 80616c0d
      Johannes Berg 提交于
      Implement the necessary software segmentation on the normal
      TX path so that fast-xmit can use segmentation offload if
      the hardware (or driver) supports it.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      80616c0d
    • J
      mac80211: allow drivers to support S/G · 680a0dab
      Johannes Berg 提交于
      If drivers want to support S/G (really just gather DMA on TX) then
      we can now easily support this on the fast-xmit path since it just
      needs to write to the ethernet header (and already has a check for
      that being possible.)
      
      However, disallow this on the regular TX path (which has to handle
      fragmentation, software crypto, etc.) by calling skb_linearize().
      
      Also allow the related HIGHDMA since that's not interesting to the
      code in mac80211 at all anyway.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      680a0dab
    • J
      mac80211: allow checksum offload only in fast-xmit · 2d981fdd
      Johannes Berg 提交于
      When we go through the complete TX processing, there are a number
      of things like fragmentation and software crypto that require the
      checksum to be calculated already.
      
      In favour of maintainability, instead of adding the necessary call
      to skb_checksum_help() in all the places that need it, just do it
      once before the regular TX processing.
      
      Right now this only affects the TI wlcore and QCA ath10k drivers
      since they're the only ones using checksum offload. The previous
      commits enabled fast-xmit for them in almost all cases.
      
      For wlcore this even fixes a corner case: when a key fails to be
      programmed to hardware software encryption gets used, encrypting
      frames with a bad checksum.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2d981fdd
    • J
      mac80211: extend fast-xmit to cover IBSS · 3ffd8840
      Johannes Berg 提交于
      IBSS can be supported very easily since it uses the standard station
      authorization state etc. so it just needs to be covered by the header
      building switch statement.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3ffd8840
    • J
      mac80211: extend fast-xmit for more ciphers · e495c247
      Johannes Berg 提交于
      When crypto is offloaded then in some cases it's all handled
      by the device, and in others only some space for the IV must
      be reserved in the frame. Handle both of these cases in the
      fast-xmit path, up to a limit of 18 bytes of space for IVs.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e495c247
    • J
      mac80211: extend fast-xmit to driver fragmentation · 725b812c
      Johannes Berg 提交于
      If the driver handles fragmentation then it wouldn't
      be done in software so we can still use the fast-xmit
      path in that case.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      725b812c
    • J
      mac80211: add TX fastpath · 17c18bf8
      Johannes Berg 提交于
      In order to speed up mac80211's TX path, add the "fast-xmit" cache
      that will cache the data frame 802.11 header and other data to be
      able to build the frame more quickly. This cache is rebuilt when
      external triggers imply changes, but a lot of the checks done per
      packet today are simplified away to the check for the cache.
      
      There's also a more detailed description in the code.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      17c18bf8
  4. 20 4月, 2015 2 次提交
    • J
      mac80211: lock rate control · 35c347ac
      Johannes Berg 提交于
      Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate
      control aren't properly taking concurrency into account. It's
      likely that the same is true for other rate control algorithms.
      
      In the case of minstrel this manifests itself in crashes when an
      update and other data access are run concurrently, for example
      when the stations change bandwidth or similar. In iwlwifi, this
      can cause firmware crashes.
      
      Since fixing all rate control algorithms will be very difficult,
      just provide locking for invocations. This protects the internal
      data structures the algorithms maintain.
      
      I've manipulated hostapd to test this, by having it change its
      advertised bandwidth roughly ever 150ms. At the same time, I'm
      running a flood ping between the client and the AP, which causes
      this race of update vs. get_rate/status to easily happen on the
      client. With this change, the system survives this test.
      Reported-by: NSven Eckelmann <sven@open-mesh.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      35c347ac
    • B
      mac80211: introduce plink lock for plink fields · 48bf6bed
      Bob Copeland 提交于
      The mesh plink code uses sta->lock to serialize access to the
      plink state fields between the peer link state machine and the
      peer link timer.  Some paths (e.g. those involving
      mps_qos_null_tx()) unfortunately hold this spinlock across
      frame tx, which is soon to be disallowed.  Add a new spinlock
      just for plink access.
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      48bf6bed
  5. 08 4月, 2015 1 次提交
  6. 07 4月, 2015 1 次提交
  7. 02 4月, 2015 10 次提交
  8. 01 4月, 2015 4 次提交
    • J
      mac80211: fix RX A-MPDU session reorder timer deletion · 788211d8
      Johannes Berg 提交于
      There's an issue with the way the RX A-MPDU reorder timer is
      deleted that can cause a kernel crash like this:
      
       * tid_rx is removed - call_rcu(ieee80211_free_tid_rx)
       * station is destroyed
       * reorder timer fires before ieee80211_free_tid_rx() runs,
         accessing the station, thus potentially crashing due to
         the use-after-free
      
      The station deletion is protected by synchronize_net(), but
      that isn't enough -- ieee80211_free_tid_rx() need not have
      run when that returns (it deletes the timer.) We could use
      rcu_barrier() instead of synchronize_net(), but that's much
      more expensive.
      
      Instead, to fix this, add a field tracking that the session
      is being deleted. In this case, the only re-arming of the
      timer happens with the reorder spinlock held, so make that
      code not rearm it if the session is being deleted and also
      delete the timer after setting that field. This ensures the
      timer cannot fire after ___ieee80211_stop_rx_ba_session()
      returns, which fixes the problem.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      788211d8
    • T
      mac80211: enhance readability of Minstrel-HTs rc_stats output · 9c00bb72
      Thomas Huehn 提交于
      This patch restructures the rc_stats debugfs table of Minstrel-HT in
      order to achieve better human readability. A new layout of the
      statistics and a new header is added. In addition to the old layout
      there are two new columns of information added:
      idx	- representing the rate index of each rate in mac80211 which
      	  can be used to set specific rates as fixed rate via debugfs
      airtime	- the tx-time in micro seconds that a 1200 Byte packet
      	  takes to be transmitted over the air at the given rate
      
      The old layout of rc_stats:
      
      type           rate      tpt eprob *prob ret  *ok(*cum)        ok(      cum)
      HT20/LGI       MCS0      5.6 100.0 100.0   1    0(   0)         1(        1)
      HT20/LGI   B   MCS1     10.5 100.0 100.0   0    0(   0)         1(        1)
      HT20/LGI  A    MCS2     14.8 100.0 100.0   0    0(   0)         1(        1)
      ...
      
      is changed into this new layout:
      
                  best   ________rate______    __statistics__    ________last_______    ______sum-of________
      mode guard #  rate  [name   idx airtime]  [ ø(tp) ø(prob)]  [prob.|retry|suc|att]  [#success | #attempts]
      HT20  LGI  1         MCS0     0    1480      0.0      0.0      0.0   1     0 0             0   0
      HT20  LGI  1     B   MCS1     1     740     10.5    100.0    100.0   0     0 0             1   1
      HT20  LGI  1    A    MCS2     2     496     14.8    100.0    100.0   0     0 0             1   1
      ...
      Signed-off-by: NThomas Huehn <thomas@net.t-labs.tu-berlin.de>
      Signed-off-by: NStefan Venz <ikstream86@gmail.com>
      Acked-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      9c00bb72
    • T
      mac80211: enhance readability of Minstrels rc_stats output · e161f7f6
      Thomas Huehn 提交于
      This patch restructures the rc_stats debugfs table of Minstrel in
      order to achieve better human readability. A new layout of the
      statistics and a new header is added. In addition to the old layout
      there are two new columns of information added:
      idx	- representing the rate index of each rate in mac80211 which
      	  can be used to set specific rates as fixed rate via debugfs
      airtime - the tx-time in micro seconds that a 1200 Byte packet
      	  takes to be transmitted over the air at the given rate
      
      The old layout of rc_stats:
      
          rate      tpt  eprob *prob ret  *ok(*cum)        ok(      cum)
       DP 1          0.9  93.5 100.0   1    0(   0)         2(        2)
          2          0.4  40.0 100.0   0    0(   0)         4(        10)
          5.5        0.0   0.0   0.0   0    0(   0)         0(        0)
      ...
      
      is changed into this new layout:
      
      best   _______rate_____    __statistics__    ________last_______    ______sum-of________
      rate  [name idx tx-time]  [ ø(tp) ø(prob)]  [prob.|retry|suc|att]  [#success | #attempts]
       DP   1     0     9738      0.9    93.5     100.0   1     1 1             2   2
            2     1     4922      0.4    40.0     100.0   1     0 0             4   10
            5.5   2     1858      0.0     0.0       0.0   2     0 0             0   0
      ...
      Signed-off-by: NThomas Huehn <thomas@net.t-labs.tu-berlin.de>
      Signed-off-by: NStefan Venz <ikstream86@gmail.com>
      Acked-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e161f7f6
    • J
      mac80211: use rhashtable for station table · 7bedd0cf
      Johannes Berg 提交于
      We currently have a hand-rolled table with 256 entries and are
      using the last byte of the MAC address as the hash. This hash
      is obviously very fast, but collisions are easily created and
      we waste a lot of space in the common case of just connecting
      as a client to an AP where we just have a single station. The
      other common case of an AP is also suboptimal due to the size
      of the hash table and the ease of causing collisions.
      
      Convert all of this to use rhashtable with jhash, which gives
      us the advantage of a far better hash function (with random
      perturbation to avoid hash collision attacks) and of course
      that the hash table grows and shrinks dynamically with chain
      length, improving both cases above.
      
      Use a specialised hash function (using jhash, but with fixed
      length) to achieve better compiler optimisation as suggested
      by Sergey Ryazanov.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7bedd0cf
  9. 30 3月, 2015 12 次提交