1. 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
  2. 08 4月, 2015 1 次提交
  3. 07 4月, 2015 1 次提交
  4. 02 4月, 2015 10 次提交
  5. 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
  6. 30 3月, 2015 20 次提交
  7. 20 3月, 2015 2 次提交