diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2025-01-14 19:53:15 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-01-15 19:13:34 -0800 |
| commit | eeeec1d4c6930691fc59858799b8a7443d9d30ee (patch) | |
| tree | 94634949d7aea24b33ed4a8e49bc232982a6889a /net/core/dev.c | |
| parent | 413f0271f3966e0c73d4937963f19335af19e628 (diff) | |
net: make netdev netlink ops hold netdev_lock()
In prep for dropping rtnl_lock, start locking netdev->lock in netlink
genl ops. We need to be using netdev->up instead of flags & IFF_UP.
We can remove the RCU lock protection for the NAPI since NAPI list
is protected by netdev->lock already.
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250115035319.559603-8-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index cfd88bc6ce5f..2ef50a3ee4a1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -768,7 +768,8 @@ static struct napi_struct *napi_by_id(unsigned int napi_id) } /* must be called under rcu_read_lock(), as we dont take a reference */ -struct napi_struct *netdev_napi_by_id(struct net *net, unsigned int napi_id) +static struct napi_struct * +netdev_napi_by_id(struct net *net, unsigned int napi_id) { struct napi_struct *napi; |
