kernel_optimize_test/net
Lior Cohen 624ff4b210 mac80211: clear crypto tx tailroom counter upon keys enable
In case we got a fw restart while roaming from encrypted AP to
non-encrypted one, we might end up with hitting a warning on the pending
counter crypto_tx_tailroom_pending_dec having a non-zero value.

The following comment taken from net/mac80211/key.c explains the rational
for the delayed tailroom needed:

	/*
	* The reason for the delayed tailroom needed decrementing is to
	* make roaming faster: during roaming, all keys are first deleted
	* and then new keys are installed. The first new key causes the
	* crypto_tx_tailroom_needed_cnt to go from 0 to 1, which invokes
	* the cost of synchronize_net() (which can be slow). Avoid this
	* by deferring the crypto_tx_tailroom_needed_cnt decrementing on
	* key removal for a while, so if we roam the value is larger than
	* zero and no 0->1 transition happens.
	*
	* The cost is that if the AP switching was from an AP with keys
	* to one without, we still allocate tailroom while it would no
	* longer be needed. However, in the typical (fast) roaming case
	* within an ESS this usually won't happen.
	*/

The next flow lead to the warning eventually reported as a bug:
1. Disconnect from encrypted AP
2. Set crypto_tx_tailroom_pending_dec = 1 for the key
3. Schedule work
4. Reconnect to non-encrypted AP
5. Add a new key, setting the tailroom counter = 1
6. Got FW restart while pending counter is set ---> hit the warning

While on it, the ieee80211_reset_crypto_tx_tailroom() func was merged into
its single caller ieee80211_reenable_keys (previously called
ieee80211_enable_keys). Also, we reset the crypto_tx_tailroom_pending_dec
and remove the counters warning as we just reset both.

Signed-off-by: Lior Cohen <lior2.cohen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20190830112451.21655-7-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-09-11 09:33:28 +02:00
..
6lowpan 6lowpan: no need to check return value of debugfs_create functions 2019-07-06 12:50:01 +02:00
9p 9p pull request for inclusion in 5.13 2019-07-12 17:31:19 -07:00
802
8021q
appletalk net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
atm
ax25
batman-adv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
bluetooth Bluetooth: Add debug setting for changing minimum encryption key size 2019-08-17 13:54:40 +03:00
bpf bpf/flow_dissector: support flags in BPF_PROG_TEST_RUN 2019-07-25 18:00:41 -07:00
bpfilter Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
bridge net: bridge: mdb: allow add/delete for host-joined groups 2019-08-17 12:36:57 -07:00
caif
can can: gw: add support for CAN FD frames 2019-08-13 17:32:21 +02:00
ceph Lots of exciting things this time! 2019-07-18 11:05:25 -07:00
core net: flow_offload: convert block_ing_cb_list to regular list type 2019-08-19 13:02:38 -07:00
dcb
dccp proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
decnet
dns_resolver Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
dsa net: dsa: enable and disable all ports 2019-08-20 12:33:49 -07:00
ethernet
hsr hsr: switch ->dellink() to ->ndo_uninit() 2019-07-11 14:37:45 -07:00
ieee802154 inet: frags: re-introduce skb coalescing for local delivery 2019-08-08 15:55:10 -07:00
ife
ipv4 nexthops: remove redundant assignment to variable err 2019-08-22 12:14:05 -07:00
ipv6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
iucv net/af_iucv: mark expected switch fall-throughs 2019-07-29 10:26:14 -07:00
kcm net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
key Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-07-08 19:48:57 -07:00
l2tp compat_ioctl: pppoe: fix PPPOEIOCSFWD handling 2019-07-30 14:42:13 -07:00
l3mdev
lapb
llc
mac80211 mac80211: clear crypto tx tailroom counter upon keys enable 2019-09-11 09:33:28 +02:00
mac802154
mpls proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
ncsi
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
netlabel
netlink
netrom netrom: hold sock when setting skb->destructor 2019-07-24 15:49:05 -07:00
nfc NFC: fix attrs checks in netlink interface 2019-07-29 08:56:26 -07:00
nsh
openvswitch Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
packet net/packet: fix race in tpacket_snd() 2019-08-15 13:59:48 -07:00
phonet
psample
qrtr
rds rds: check for excessive looping in rds_send_xmit 2019-08-15 12:04:24 -07:00
rfkill
rose
rxrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
sched Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
sctp sctp: remove net sctp.x_enable working as a global switch 2019-08-19 18:27:29 -07:00
smc net/smc: avoid fallback in case of non-blocking connect 2019-08-05 13:24:37 -07:00
strparser
sunrpc Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
switchdev
tipc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
tls Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
unix
vmw_vsock Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-06 18:44:57 -07:00
wimax wimax: no need to check return value of debugfs_create functions 2019-08-10 15:25:47 -07:00
wireless cfg80211: always shut down on HW rfkill 2019-09-11 09:13:26 +02:00
x25
xdp xdp: xdp_umem: fix umem pages mapping for 32bits systems 2019-08-09 18:02:19 +02:00
xfrm net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
compat.c
Kconfig devlink: Add packet trap infrastructure 2019-08-17 12:40:08 -07:00
Makefile
socket.c Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
sysctl_net.c