2019-06-04 10:11:33 +02:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2014-09-03 15:24:57 +03:00
|
|
|
|
2017-09-05 14:54:54 +02:00
|
|
|
|
2025-07-21 09:20:03 +03:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
|
|
|
|
|
2023-08-23 18:32:25 +08:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MAC80211]: fix race conditions with keys
During receive processing, we select the key long before using it and
because there's no locking it is possible that we kfree() the key
after having selected it but before using it for crypto operations.
Obviously, this is bad.
Secondly, during transmit processing, there are two possible races: We
have a similar race between select_key() and using it for encryption,
but we also have a race here between select_key() and hardware
encryption (both when a key is removed.)
This patch solves these issues by using RCU: when a key is to be freed,
we first remove the pointer from the appropriate places (sdata->keys,
sdata->default_key, sta->key) using rcu_assign_pointer() and then
synchronize_rcu(). Then, we can safely kfree() the key and remove it
from the hardware. There's a window here where the hardware may still
be using it for decryption, but we can't work around that without having
two hardware callbacks, one to disable the key for RX and one to disable
it for TX; but the worst thing that will happen is that we receive a
packet decrypted that we don't find a key for any more and then drop it.
When we add a key, we first need to upload it to the hardware and then,
using rcu_assign_pointer() again, link it into our structures.
In the code using keys (TX/RX paths) we use rcu_dereference() to get the
key and enclose the whole tx/rx section in a rcu_read_lock() ...
rcu_read_unlock() block. Because we've uploaded the key to hardware
before linking it into internal structures, we can guarantee that it is
valid once get to into tx().
One possible race condition remains, however: when we have hardware
acceleration enabled and the driver shuts down the queues, we end up
queueing the frame. If now somebody removes the key, the key will be
removed from hwaccel and then then driver will be asked to encrypt the
frame with a key index that has been removed. Hence, drivers will need
to be aware that the hw_key_index they are passed might not be under
all circumstances. Most drivers will, however, simply ignore that
condition and encrypt the frame with the selected key anyway, this
only results in a frame being encrypted with a wrong key or dropped
(rightfully) because the key was not valid. There isn't much we can
do about it unless we want to walk the pending frame queue every time
a key is removed and remove all frames that used it.
This race condition, however, will most likely be solved once we add
multiqueue support to mac80211 because then frames will be queued
further up the stack instead of after being processed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-09-14 11:10:24 -04:00
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2011-07-15 11:47:34 -04:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
2024-10-01 15:35:57 -04:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
2009-04-23 18:52:52 +02:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2008-02-26 14:34:06 +01:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-03 19:51:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2011-01-03 19:51:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-17 13:54:54 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2015-06-17 13:54:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
2015-06-17 13:54:54 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2015-06-17 13:54:54 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2015-06-17 13:54:54 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2018-03-28 18:34:19 +05:30
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
2015-01-22 18:44:19 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2014-10-13 13:43:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-16 21:44:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-13 13:43:29 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2014-10-13 13:43:29 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
2008-12-29 12:55:09 +01:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-02 21:39:54 +02:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
|
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 08:11:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-09 15:01:38 +01:00
|
|
|
|
|
|
|
|
|
2010-11-19 08:11:01 +01:00
|
|
|
|
2019-02-09 15:01:38 +01:00
|
|
|
|
2010-11-19 08:11:01 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2022-09-02 16:12:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
2019-03-16 21:44:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
2011-10-23 08:21:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-01 13:50:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2015-01-22 18:44:19 +01:00
|
|
|
|
2012-06-22 11:29:50 +02:00
|
|
|
|
2010-08-20 16:25:38 -07:00
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
|
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:07 +02:00
|
|
|
|
2020-02-03 13:28:12 +01:00
|
|
|
|
|
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
|
|
|
|
|
2015-01-22 18:44:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-09 15:01:38 +01:00
|
|
|
|
2015-01-22 18:44:19 +01:00
|
|
|
|
2010-10-05 19:39:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-29 12:55:09 +01:00
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
2008-12-29 12:55:09 +01:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-09-02 16:12:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-16 21:44:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2009-11-25 20:30:31 +01:00
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2012-06-22 11:29:50 +02:00
|
|
|
|
2010-08-20 16:25:38 -07:00
|
|
|
|
2012-01-20 13:55:19 +01:00
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2020-03-26 15:09:42 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2020-03-26 15:09:42 +02:00
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
2020-03-26 15:09:42 +02:00
|
|
|
|
2019-06-29 21:50:14 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-26 15:09:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2019-06-29 21:50:14 +02:00
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
2019-06-29 21:50:13 +02:00
|
|
|
|
|
|
|
|
|
2019-06-29 21:50:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:04 +02:00
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2012-05-30 11:36:39 +03:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2015-03-21 15:25:43 +01:00
|
|
|
|
2016-12-13 09:39:18 +01:00
|
|
|
|
|
|
|
|
|
2012-05-30 11:36:39 +03:00
|
|
|
|
|
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-05-19 17:57:53 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2013-10-29 10:00:08 +01:00
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2013-10-29 10:00:08 +01:00
|
|
|
|
2022-05-19 17:57:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2022-05-19 17:57:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:01 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-19 17:57:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
|
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2019-05-06 21:01:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2025-10-19 11:54:27 +03:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2025-10-19 11:54:27 +03:00
|
|
|
|
|
|
|
|
|
2023-06-21 14:44:36 +03:00
|
|
|
|
2025-10-19 11:54:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2020-03-26 15:09:42 +02:00
|
|
|
|
|
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2011-05-13 14:15:49 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2011-05-13 14:15:49 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2011-05-13 14:15:49 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
|
|
|
|
|
2011-01-03 19:51:09 +01:00
|
|
|
|
2015-11-17 10:24:37 +02:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-09 13:14:26 +01:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
|
|
|
|
|
2010-08-01 17:37:03 +01:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-29 17:55:26 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
2010-08-01 17:37:03 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-08-10 09:46:38 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2010-08-10 09:46:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
|
|
|
|
|
2008-10-05 18:02:48 +02:00
|
|
|
|
2010-08-10 09:46:38 +02:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
|
|
|
|
|
2009-05-15 12:38:32 +03:00
|
|
|
|
2012-11-14 23:22:21 +01:00
|
|
|
|
2009-05-11 21:57:58 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mac80211: fix TKIP races, make API easier to use
Our current TKIP code races against itself on TX
since we can process multiple packets at the same
time on different ACs, but they all share the TX
context for TKIP. This can lead to bad IVs etc.
Also, the crypto offload helper code just obtains
the P1K/P2K from the cache, and can update it as
well, but there's no guarantee that packets are
really processed in order.
To fix these issues, first introduce a spinlock
that will protect the IV16/IV32 values in the TX
context. This first step makes sure that we don't
assign the same IV multiple times or get confused
in other ways.
Secondly, change the way the P1K cache works. I
add a field "p1k_iv32" that stores the value of
the IV32 when the P1K was last recomputed, and
if different from the last time, then a new P1K
is recomputed. This can cause the P1K computation
to flip back and forth if packets are processed
out of order. All this also happens under the new
spinlock.
Finally, because there are argument differences,
split up the ieee80211_get_tkip_key() API into
ieee80211_get_tkip_p1k() and ieee80211_get_tkip_p2k()
and give them the correct arguments.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-07 22:28:01 +02:00
|
|
|
|
2008-10-05 18:02:48 +02:00
|
|
|
|
2010-08-10 09:46:38 +02:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
|
|
|
|
|
2009-05-15 12:38:32 +03:00
|
|
|
|
2012-11-14 23:22:21 +01:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2009-05-11 21:57:58 +03:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2009-05-11 21:57:58 +03:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-01 17:37:03 +01:00
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2011-03-27 13:31:26 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2010-08-10 09:46:39 +02:00
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2010-08-10 09:46:39 +02:00
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-10 09:46:39 +02:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2012-11-14 23:15:11 +01:00
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2010-08-01 17:37:03 +01:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2011-03-27 13:31:26 +02:00
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2010-08-10 09:46:39 +02:00
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2010-08-10 09:46:39 +02:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:07 +02:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
|
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
|
|
|
|
|
2010-07-26 15:52:03 -07:00
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-17 10:24:37 +02:00
|
|
|
|
|
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
|
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
|
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
|
|
|
|
|
2017-10-24 21:12:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
2021-05-11 20:02:43 +02:00
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
mac80211: restrict delayed tailroom needed decrement
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>
2018-07-10 16:48:27 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:48 +03:00
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:01 +02:00
|
|
|
|
2023-10-20 09:38:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-05-16 15:00:15 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
|
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
2019-03-19 21:34:08 +01:00
|
|
|
|
2008-02-25 16:27:45 +01:00
|
|
|
|
2017-09-05 14:54:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-24 21:12:13 +02:00
|
|
|
|
2023-09-19 08:34:15 +02:00
|
|
|
|
2023-10-05 22:57:34 +02:00
|
|
|
|
2017-09-05 14:54:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-11 20:02:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-02 21:35:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-28 18:41:37 +05:30
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
[MAC80211]: fix race conditions with keys
During receive processing, we select the key long before using it and
because there's no locking it is possible that we kfree() the key
after having selected it but before using it for crypto operations.
Obviously, this is bad.
Secondly, during transmit processing, there are two possible races: We
have a similar race between select_key() and using it for encryption,
but we also have a race here between select_key() and hardware
encryption (both when a key is removed.)
This patch solves these issues by using RCU: when a key is to be freed,
we first remove the pointer from the appropriate places (sdata->keys,
sdata->default_key, sta->key) using rcu_assign_pointer() and then
synchronize_rcu(). Then, we can safely kfree() the key and remove it
from the hardware. There's a window here where the hardware may still
be using it for decryption, but we can't work around that without having
two hardware callbacks, one to disable the key for RX and one to disable
it for TX; but the worst thing that will happen is that we receive a
packet decrypted that we don't find a key for any more and then drop it.
When we add a key, we first need to upload it to the hardware and then,
using rcu_assign_pointer() again, link it into our structures.
In the code using keys (TX/RX paths) we use rcu_dereference() to get the
key and enclose the whole tx/rx section in a rcu_read_lock() ...
rcu_read_unlock() block. Because we've uploaded the key to hardware
before linking it into internal structures, we can guarantee that it is
valid once get to into tx().
One possible race condition remains, however: when we have hardware
acceleration enabled and the driver shuts down the queues, we end up
queueing the frame. If now somebody removes the key, the key will be
removed from hwaccel and then then driver will be asked to encrypt the
frame with a key index that has been removed. Hence, drivers will need
to be aware that the hw_key_index they are passed might not be under
all circumstances. Most drivers will, however, simply ignore that
condition and encrypt the frame with the selected key anyway, this
only results in a frame being encrypted with a wrong key or dropped
(rightfully) because the key was not valid. There isn't much we can
do about it unless we want to walk the pending frame queue every time
a key is removed and remove all frames that used it.
This race condition, however, will most likely be solved once we add
multiqueue support to mac80211 because then frames will be queued
further up the stack instead of after being processed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-09-14 11:10:24 -04:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2018-08-31 15:00:38 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2013-03-06 22:53:52 +01:00
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
|
|
|
|
|
2017-09-05 14:54:54 +02:00
|
|
|
|
2023-09-19 08:34:16 +02:00
|
|
|
|
2010-08-27 14:26:52 +03:00
|
|
|
|
2008-04-09 16:45:37 +02:00
|
|
|
|
|
|
|
|
|
2013-03-06 22:58:23 +01:00
|
|
|
|
2008-04-09 16:45:37 +02:00
|
|
|
|
2011-05-12 14:31:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-09 16:45:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-06 22:58:23 +01:00
|
|
|
|
2007-07-27 15:43:23 +02:00
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:49 +03:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2010-06-01 10:19:19 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2019-08-30 14:24:49 +03:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:49 +03:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2019-08-30 14:24:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-18 09:28:29 +02:00
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:49 +03:00
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-06 17:36:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-05 16:35:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2011-07-05 16:35:39 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2011-07-05 16:35:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2024-10-06 17:36:30 +02:00
|
|
|
|
2011-07-05 16:35:39 +02:00
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
2024-10-06 17:36:30 +02:00
|
|
|
|
|
|
|
|
|
2011-07-05 16:35:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-17 10:24:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-06 17:36:30 +02:00
|
|
|
|
|
|
|
|
|
2015-11-17 10:24:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
|
|
|
|
|
2008-04-08 17:56:52 +02:00
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
|
|
|
|
|
2009-01-08 13:32:02 +02:00
|
|
|
|
2020-02-22 15:25:44 +02:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
2010-12-09 19:49:02 +01:00
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:47 +02:00
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-04 23:47:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-28 17:01:55 -04:00
|
|
|
|
2011-07-05 16:35:41 +02:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-04 23:05:45 +01:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
|
|
|
|
|
mac80211: prepare sta handling for MLO support
Currently in mac80211 each STA object is represented
using sta_info datastructure with the associated
STA specific information and drivers access ieee80211_sta
part of it.
With MLO (Multi Link Operation) support being added
in 802.11be standard, though the association is logically
with a single Multi Link capable STA, at the physical level
communication can happen via different advertised
links (uniquely identified by Channel, operating class,
BSSID) and hence the need to handle multiple link
STA parameters within a composite sta_info object
called the MLD STA. The different link STA part of
MLD STA are identified using the link address which can
be same or different as the MLD STA address and unique
link id based on the link vif.
To support extension of such a model, the sta_info
datastructure is modified to hold multiple link STA
objects with link specific params currently within
sta_info moved to this new structure. Similarly this is
done for ieee80211_sta as well which will be accessed
within mac80211 as well as by drivers, hence trivial
driver changes are expected to support this.
For current non MLO supported drivers, only one link STA
is present and link information is accessed via 'deflink'
member.
For MLO drivers, we still need to define the APIs etc. to
get the correct link ID and access the correct part of
the station info.
Currently in mac80211, all link STA info are accessed directly
via deflink. These will be updated to access via link pointers
indexed by link id with MLO support patches, with link id
being 0 for non MLO supported cases.
Except for couple of macro related changes, below spatch takes
care of updating mac80211 and driver code to access to the
link STA info via deflink.
@ieee80211_sta@
struct ieee80211_sta *s;
struct sta_info *si;
identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr};
@@
(
s->
- var
+ deflink.var
|
si->sta.
- var
+ deflink.var
)
@sta_info@
struct sta_info *si;
identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth};
@@
(
si->
- var
+ deflink.var
)
Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com
[remove MLO-drivers notes from commit message, not clear yet; run spatch]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-04-04 21:11:23 +05:30
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mac80211: restrict delayed tailroom needed decrement
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>
2018-07-10 16:48:27 +05:30
|
|
|
|
|
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
2023-08-28 14:00:02 +02:00
|
|
|
|
2013-03-24 14:23:27 +02:00
|
|
|
|
|
|
|
|
|
2022-08-17 11:17:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mac80211: restrict delayed tailroom needed decrement
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>
2018-07-10 16:48:27 +05:30
|
|
|
|
|
|
|
|
|
2013-12-04 23:05:45 +01:00
|
|
|
|
2013-03-06 23:09:11 +01:00
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:47 +02:00
|
|
|
|
|
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-13 09:16:48 +00:00
|
|
|
|
|
|
|
|
|
mac80211: defer tailroom counter manipulation when roaming
During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.
To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.
Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.
(*) it starts at 0 because HW crypto is on, then goes to
1 when HW crypto is disabled for a key, then back to
0 because the key is deleted; this happens for both
keys in the example. When new keys are added, it goes
to 1 first because they're added in software; when a
key is moved to hardware it goes back to 0
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-23 00:59:03 +01:00
|
|
|
|
|
|
|
|
|
2011-07-05 16:35:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-14 23:22:21 +01:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:07 +02:00
|
|
|
|
2012-11-14 23:22:21 +01:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
2012-11-14 23:22:21 +01:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 13:09:08 +02:00
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-07 18:58:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:07 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:08 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-24 19:52:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-21 21:50:49 +03:00
|
|
|
|
2024-02-28 09:44:56 +01:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-21 21:50:49 +03:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
2024-02-28 09:44:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-21 21:50:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-09 13:14:26 +01:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
2013-08-28 19:03:36 +02:00
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-02 16:20:05 +02:00
|
|
|
|
2024-02-28 09:44:56 +01:00
|
|
|
|
|
|
|
|
|
2013-08-07 20:11:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-29 17:30:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-02 16:12:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|