Skip to content

Commit 062e789

Browse files
committed
netdev-genl: remove rtnl_lock protection from NAPI ops
NAPI lifetime, visibility and config are all fully under netdev_lock protection now. Reviewed-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250115035319.559603-12-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e7ed2ba commit 062e789

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

net/core/netdev-genl.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info)
229229
if (!rsp)
230230
return -ENOMEM;
231231

232-
rtnl_lock();
233-
234232
napi = netdev_napi_by_id_lock(genl_info_net(info), napi_id);
235233
if (napi) {
236234
err = netdev_nl_napi_fill_one(rsp, napi, info);
@@ -240,8 +238,6 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info)
240238
err = -ENOENT;
241239
}
242240

243-
rtnl_unlock();
244-
245241
if (err) {
246242
goto err_free_msg;
247243
} else if (!rsp->len) {
@@ -300,7 +296,6 @@ int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
300296
if (info->attrs[NETDEV_A_NAPI_IFINDEX])
301297
ifindex = nla_get_u32(info->attrs[NETDEV_A_NAPI_IFINDEX]);
302298

303-
rtnl_lock();
304299
if (ifindex) {
305300
netdev = netdev_get_by_index_lock(net, ifindex);
306301
if (netdev) {
@@ -317,7 +312,6 @@ int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
317312
ctx->napi_id = 0;
318313
}
319314
}
320-
rtnl_unlock();
321315

322316
return err;
323317
}
@@ -358,8 +352,6 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info)
358352

359353
napi_id = nla_get_u32(info->attrs[NETDEV_A_NAPI_ID]);
360354

361-
rtnl_lock();
362-
363355
napi = netdev_napi_by_id_lock(genl_info_net(info), napi_id);
364356
if (napi) {
365357
err = netdev_nl_napi_set_config(napi, info);
@@ -369,8 +361,6 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info)
369361
err = -ENOENT;
370362
}
371363

372-
rtnl_unlock();
373-
374364
return err;
375365
}
376366

0 commit comments

Comments
 (0)