net: dev_addr_lists: move locking out of init/exit in kunit
authorJakub Kicinski <kuba@kernel.org>
Thu, 11 Apr 2024 18:32:22 +0000 (11:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Apr 2024 09:26:35 +0000 (10:26 +0100)
commit3db3b62955cd6d73afde05a17d7e8e106695c3b9
tree83a632449cb2285047895b381941a77ec4b362ad
parentf1e197a665c2148ebc25fe09c53689e60afea195
net: dev_addr_lists: move locking out of init/exit in kunit

We lock and unlock rtnl in init/exit for convenience,
but it started causing problems if the exit is handled
by a different thread. To avoid having to futz with
disabling locking assertions move the locking into
the test cases. We don't use ASSERTs so it should
be safe.

   ============= dev-addr-list-test (6 subtests) ==============
   [PASSED] dev_addr_test_basic
   [PASSED] dev_addr_test_sync_one
   [PASSED] dev_addr_test_add_del
   [PASSED] dev_addr_test_del_main
   [PASSED] dev_addr_test_add_set
   [PASSED] dev_addr_test_add_excl
   =============== [PASSED] dev-addr-list-test ================

Link: https://lore.kernel.org/all/20240403131936.787234-7-linux@roeck-us.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_addr_lists_test.c