]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: protect threaded status of NAPI with netdev_lock()
authorJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 03:53:16 +0000 (19:53 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jan 2025 03:13:34 +0000 (19:13 -0800)
commit1bb86cf8f44b1c1a320566558250b1f5121f6fd3
treeb37b1e25e9a09d845fdafeb292e12cde579a6a48
parenteeeec1d4c6930691fc59858799b8a7443d9d30ee
net: protect threaded status of NAPI with netdev_lock()

Now that NAPI instances can't come and go without holding
netdev->lock we can trivially switch from rtnl_lock() to
netdev_lock() for setting netdev->threaded via sysfs.

Note that since we do not lock netdev_lock around sysfs
calls in the core we don't have to "trylock" like we do
with rtnl_lock.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250115035319.559603-9-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
net/core/dev.c
net/core/net-sysfs.c