1. 16 Dec, 2013 9 commits
    • Johannes Berg's avatar
      mac80211: free all AP/VLAN keys at once · 7907c7d3
      Johannes Berg authored
      When the AP interface is stopped, free all AP and VLAN keys at
      once to only require synchronize_net() once. Since that does
      synchronize_net(), also move two such calls into the function
      (using the new force_synchronize parameter) to avoid doing it
      twice.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      7907c7d3
    • Johannes Berg's avatar
      mac80211: optimise mixed AP/VLAN station removal · e716251d
      Johannes Berg authored
      Teach sta_info_flush() to optionally also remove stations
      from all VLANs associated with an AP interface to optimise
      the station removal (in particular, synchronize_net().)
      
      To not have to add the vlans argument throughout, do some
      refactoring.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      e716251d
    • Johannes Berg's avatar
      mac80211: optimise synchronize_net() for sta_info_flush · d778207b
      Johannes Berg authored
      There's no reason to have one synchronize_net() for each
      removed station, refactor the code slightly to have just
      a single synchronize_net() for all stations.
      
      Note that this is currently useless as hostapd removes
      stations one by one and this coalescing never happens.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      d778207b
    • Johannes Berg's avatar
      mac80211: move synchronize_net() before sta key removal · c8782078
      Johannes Berg authored
      There's no reason to do this inside the sta key removal
      since the keys can only be reached through the sta (and
      not by the driver at all) so once the sta can no longer
      be reached, the keys are safe.
      
      This will allow further optimisation opportunities with
      multiple stations.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      c8782078
    • Johannes Berg's avatar
      mac80211: don't delay station destruction · d34ba216
      Johannes Berg authored
      If we can assume that stations are never referenced by the
      driver after sta_state returns (and this is true since the
      previous iwlmvm patch and for all other drivers) then we
      don't need to delay station destruction, and don't need to
      play tricks with rcu_barrier() etc.
      
      This should speed up some scenarios like hostapd shutdown.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      d34ba216
    • Johannes Berg's avatar
      mac80211: move 4-addr sta pointer clearing before synchronize_rcu() · a710c816
      Johannes Berg authored
      The pointer should be cleared before synchronize_rcu() so that the
      consequently dead station won't be found by any lookups in the TX
      or RX paths.
      
      Also check that the station is actually the one being removed, the
      check is not needed because each 4-addr VLAN can only have a single
      station and non-4-addr VLANs always have a NULL pointer there, but
      the code is clearer this way (and we avoid the memory write.)
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      a710c816
    • Johannes Berg's avatar
      iwlwifi: mvm: use pre-RCU-sync sta removal operation · 1ddbbb0c
      Johannes Berg authored
      iwlmvm relies on the current mac80211 behaviour of allowing
      station pointers to be valid for an RCU grace period after
      returning from the sta_state() callback. To optimise these
      cases, this behaviour is going away, so make the driver use
      the new sta_pre_rcu_remove() method to clear the pointer in
      the fw_id_to_mac_id[] array.
      
      Since this may happen while the station is still present in
      the firmware, don't set the pointer to NULL but to -ENOENT
      to mark this particular case. In client mode, the station
      is kept even longer (until marking the MAC as unassociated)
      so the drain flow must take this new behavior into account.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1ddbbb0c
    • Johannes Berg's avatar
      mac80211: add pre-RCU-sync sta removal driver operation · 6a9d1b91
      Johannes Berg authored
      Currently, mac80211 allows drivers to keep RCU-protected station
      references that are cleared when the station is removed from the
      driver and consequently needs to synchronize twice, once before
      removing the station from the driver (so it can guarantee that
      the station is no longer used in TX towards the driver) and once
      after the station is removed from the driver.
      
      Add a new pre-RCU-synchronisation station removal operation to
      the API to allow drivers to clear/invalidate their RCU-protected
      station pointers before the RCU synchronisation.
      
      This will allow removing the second synchronisation by changing
      the driver API so that the driver may no longer assume a valid
      RCU-protected pointer after sta_remove/sta_state returns.
      
      The alternative to this would be to synchronize_rcu() in all the
      drivers that currently rely on this behaviour (only iwlmvm) but
      that would defeat the purpose.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      6a9d1b91
    • Johannes Berg's avatar
  2. 11 Dec, 2013 11 commits
  3. 10 Dec, 2013 1 commit
  4. 09 Dec, 2013 19 commits