]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: ethtool: optionally skip rtnl_lock on Netlink path for GET ops
authorJakub Kicinski <kuba@kernel.org>
Fri, 5 Jun 2026 00:29:04 +0000 (17:29 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Jun 2026 17:13:04 +0000 (10:13 -0700)
commit45079e00133ee78fd216ccc4285534044ea69173
treeac7ccc9f46f8196fd6fa54c3767c775833d7ad0d
parent97f51bf91b3afa8819fa10e9282e3f2328bb78e4
net: ethtool: optionally skip rtnl_lock on Netlink path for GET ops

ethnl_default_doit() and ethnl_default_dump_one() are both used
exclusively for GET callbacks (former to get info for a single
device or get global strings). ops-locked devices don't need
rtnl_lock for GET callbacks, stop taking it.

Introduce an opt-out mechanism for devices which use phylink (fbnic)
since phylink currently depends on rtnl_lock protection. Subsequent
patches will add more exceptions, anyway. Practically the new helpers
for judging if command needs rtnl_lock could also call
netdev_need_ops_lock() but I find that it makes the code in the callers
slightly less obvious.

Add a helper for IOCTLs already, even tho it's unused so that
we can keep them in sync as the series progresses.

This is the first user-visible step of moving ethtool ops out
from under rtnl. Subsequent patches do the same for SET ops,
as well as the ioctl path.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260605002912.3456868-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve_ethtool.c
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
include/linux/ethtool.h
net/ethtool/common.h
net/ethtool/mm.c
net/ethtool/netlink.c