linux-brain/net/mac80211
Manikanta Pubbisetty 03758ba70b mac80211: restrict delayed tailroom needed decrement
[ Upstream commit 133bf90dbb ]

As explained in ieee80211_delayed_tailroom_dec(), during roam,
keys of the old AP will be destroyed and new keys will be
installed. Deletion of the old key causes
crypto_tx_tailroom_needed_cnt to go from 1 to 0 and the new key
installation causes a transition from 0 to 1.

Whenever crypto_tx_tailroom_needed_cnt transitions from 0 to 1,
we invoke synchronize_net(); the reason for doing this is to avoid
a race in the TX path as explained in increment_tailroom_need_count().
This synchronize_net() operation can be slow and can affect the station
roam time. To avoid this, decrementing the crypto_tx_tailroom_needed_cnt
is delayed for a while so that upon installation of new key the
transition would be from 1 to 2 instead of 0 to 1 and thereby
improving the roam time.

This is all correct for a STA iftype, but deferring the tailroom_needed
decrement for other iftypes may be unnecessary.

For example, let's consider the case of a 4-addr client connecting to
an AP for which AP_VLAN interface is also created, let the initial
value for tailroom_needed on the AP be 1.

* 4-addr client connects to the AP (AP: tailroom_needed = 1)
* AP will clear old keys, delay decrement of tailroom_needed count
* AP_VLAN is created, it takes the tailroom count from master
  (AP_VLAN: tailroom_needed = 1, AP: tailroom_needed = 1)
* Install new key for the station, assume key is plumbed in the HW,
  there won't be any change in tailroom_needed count on AP iface
* Delayed decrement of tailroom_needed count on AP
  (AP: tailroom_needed = 0, AP_VLAN: tailroom_needed = 1)

Because of the delayed decrement on AP iface, tailroom_needed count goes
out of sync between AP(master iface) and AP_VLAN(slave iface) and
there would be unnecessary tailroom created for the packets going
through AP_VLAN iface.

Also, WARN_ONs were observed while trying to bring down the AP_VLAN
interface:
(warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
(warn_slowpath_null) (ieee80211_free_keys+0x114/0x1e4)
(ieee80211_free_keys) (ieee80211_del_virtual_monitor+0x51c/0x850)
(ieee80211_del_virtual_monitor) (ieee80211_stop+0x30/0x3c)
(ieee80211_stop) (__dev_close_many+0x94/0xb8)
(__dev_close_many) (dev_close_many+0x5c/0xc8)

Restricting delayed decrement to station interface alone fixes the problem
and it makes sense to do so because delayed decrement is done to improve
roam time which is applicable only for client devices.

Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:36:33 +02:00
..
aes_ccm.c mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
aes_ccm.h mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
aes_cmac.c mac80211: remove ieee80211_aes_cmac_calculate_k1_k2() 2015-08-13 11:31:45 +02:00
aes_cmac.h mac80111: Add BIP-CMAC-256 cipher 2015-01-27 11:09:13 +01:00
aes_gcm.c mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
aes_gcm.h mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
aes_gmac.c mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
aes_gmac.h mac80211: move struct aead_req off the stack 2016-10-17 16:14:04 +02:00
agg-rx.c mac80211: don't reorder frames with SN smaller than SSN 2017-03-15 10:02:47 +08:00
agg-tx.c mac80211: reject TSPEC TIDs (TSIDs) for aggregation 2016-09-15 10:08:52 +02:00
cfg.c mac80211: restrict delayed tailroom needed decrement 2018-09-26 08:36:33 +02:00
chan.c mac80211: calculate min channel width correctly 2017-12-09 22:01:51 +01:00
debug.h mac80211: 802.11p OCB mode support 2014-11-04 13:18:21 +01:00
debugfs_key.c mac80211: move TKIP TX IVs to public part of key struct 2016-02-24 09:04:38 +01:00
debugfs_key.h mac80211: support separate default keys 2010-12-13 15:23:29 -05:00
debugfs_netdev.c mac80211: add offset_tsf driver op and use it for mesh 2016-09-30 13:45:44 +02:00
debugfs_netdev.h mac80211: fix some missing includes 2014-04-09 14:49:43 +02:00
debugfs_sta.c mac80211: fix tid_agg_rx NULL dereference 2017-01-12 11:39:23 +01:00
debugfs_sta.h
debugfs.c mac80211: Export fq memory limit information in debugfs 2016-09-30 13:29:31 +02:00
debugfs.h mac80211: fix some missing includes 2014-04-09 14:49:43 +02:00
driver-ops.c mac80211: add offset_tsf driver op and use it for mesh 2016-09-30 13:45:44 +02:00
driver-ops.h mac80211: Fix setting TX power on monitor interfaces 2018-04-13 19:48:10 +02:00
ethtool.c mac80211: move station statistics into sub-structs 2015-10-21 10:08:22 +02:00
ht.c mac80211: limit the A-MSDU Tx based on peer's capabilities 2016-02-24 09:04:20 +01:00
ibss.c mac80211: ibss: Fix channel type enum in ieee80211_sta_join_ibss() 2018-04-08 12:12:47 +02:00
ieee80211_i.h mac80211: Fix possible sband related NULL pointer de-reference 2018-03-24 11:00:17 +01:00
iface.c mac80211: remove BUG() when interface type is invalid 2018-03-22 09:17:57 +01:00
Kconfig mac80211: use DECLARE_EWMA 2015-08-14 17:49:53 +02:00
key.c mac80211: restrict delayed tailroom needed decrement 2018-09-26 08:36:33 +02:00
key.h mac80211: move TKIP TX IVs to public part of key struct 2016-02-24 09:04:38 +01:00
led.c mac80211: fix throughput LED trigger 2015-05-11 19:16:04 +02:00
led.h mac80211: make LED triggering depend on activation 2015-05-05 14:21:56 +02:00
main.c mac80211: initialize SMPS field in HT capabilities 2017-07-05 14:40:25 +02:00
Makefile mac80211: remove event.c 2015-10-14 18:40:26 +02:00
mesh_hwmp.c mac80211: fix the update of path metric for RANN frame 2018-02-03 17:05:37 +01:00
mesh_pathtbl.c mac80211: make mpath path fixing more robust 2016-09-12 12:27:14 +02:00
mesh_plink.c mac80211: Fix possible sband related NULL pointer de-reference 2018-03-24 11:00:17 +01:00
mesh_ps.c mac80211: mesh: separate plid and aid concepts 2015-07-17 15:47:11 +02:00
mesh_sync.c mac80211: Remove invalid flag operations in mesh TSF synchronization 2017-11-30 08:39:13 +00:00
mesh.c mac80211: Fix possible sband related NULL pointer de-reference 2018-03-24 11:00:17 +01:00
mesh.h mac80211: mesh: fix cleanup for mesh pathtable 2016-04-05 21:34:53 +02:00
michael.c
michael.h mac80211: fix some missing includes 2014-04-09 14:49:43 +02:00
mlme.c mac80211: bail out from prep_connection() if a reconfig is ongoing 2018-04-13 19:47:51 +02:00
ocb.c mac80211: remove rx_stats.last_rx update after sta alloc 2016-04-06 13:18:15 +02:00
offchannel.c mac80211: flush hw_roc_start work before cancelling the ROC 2017-10-05 09:43:58 +02:00
pm.c mac80211: flush delayed work when entering suspend 2017-03-15 10:02:47 +08:00
rate.c mac80211: Fix clang warning about constant operand in logical operation 2018-04-08 12:12:46 +02:00
rate.h mac80211: remove sta_info debugfs sub-struct 2016-04-05 11:59:05 +02:00
rc80211_minstrel_debugfs.c mac80211: minstrel[_ht]: remove non-ascii debugfs characters 2015-09-29 15:56:47 +02:00
rc80211_minstrel_ht_debugfs.c mac80211: minstrel[_ht]: remove non-ascii debugfs characters 2015-09-29 15:56:47 +02:00
rc80211_minstrel_ht.c cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
rc80211_minstrel_ht.h mac80211: add max lossless throughput per rate 2015-04-01 20:44:32 +02:00
rc80211_minstrel.c cfg80211: remove enum ieee80211_band 2016-04-12 15:56:15 +02:00
rc80211_minstrel.h mac80211: add standard deviation to Minstrel stats 2015-04-01 20:44:33 +02:00
rx.c mac80211: drop frames with unexpected DS bits from fast-rx to slow path 2018-05-30 07:50:30 +02:00
scan.c mac80211: fix scan completed tracing 2016-09-15 16:46:16 +02:00
spectmgmt.c mac80211: Do not disconnect on invalid operating class 2018-05-30 07:50:28 +02:00
sta_info.c mac80211: fix calling sleeping function in atomic context 2018-05-30 07:50:28 +02:00
sta_info.h mac80211: don't reorder frames with SN smaller than SSN 2017-03-15 10:02:47 +08:00
status.c mac80211: don't parse encrypted management frames in ieee80211_frame_acked 2018-03-24 11:00:16 +01:00
tdls.c mac80211: Fix possible sband related NULL pointer de-reference 2018-03-24 11:00:17 +01:00
tkip.c mac80211: move TKIP TX IVs to public part of key struct 2016-02-24 09:04:38 +01:00
tkip.h mac80211: move TKIP TX IVs to public part of key struct 2016-02-24 09:04:38 +01:00
trace_msg.h mac80211: Move message tracepoints to their own header 2015-04-07 12:32:09 -04:00
trace.c mac80211: Move message tracepoints to their own header 2015-04-07 12:32:09 -04:00
trace.h mac80211: add offset_tsf driver op and use it for mesh 2016-09-30 13:45:44 +02:00
tx.c mac80211: Fix possible sband related NULL pointer de-reference 2018-03-24 11:00:17 +01:00
util.c mac80211: add stations tied to AP_VLANs during hw reconfig 2018-09-05 09:19:59 +02:00
vht.c mac80211: recalculate min channel width on VHT opmode changes 2017-07-05 14:40:24 +02:00
wep.c mac80211: Add RX flag to indicate ICV stripped 2018-01-17 09:38:49 +01:00
wep.h mac80211: move RX WEP weak IV counting 2012-03-13 14:54:16 -04:00
wme.c mac80211: synchronously reserve TID per station 2014-11-19 18:45:36 +01:00
wme.h mac80211: add WMM admission control support 2014-10-22 10:42:09 +02:00
wpa.c mac80211: Add RX flag to indicate ICV stripped 2018-01-17 09:38:49 +01:00
wpa.h mac80111: Add BIP-GMAC-128 and BIP-GMAC-256 ciphers 2015-01-27 11:10:13 +01:00