net: ethtool: try to protect all callback with netdev instance lock
authorJakub Kicinski <kuba@kernel.org>
Wed, 5 Mar 2025 16:37:28 +0000 (08:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Mar 2025 20:59:44 +0000 (12:59 -0800)
commit2bcf4772e45adb00649a4e9cbff14b08a144f9e3
tree3f9472a249e9d7ee3141be0bba0b8c53bf3a6b82
parent97246d6d21c21fb4c5235770a21855e457096a96
net: ethtool: try to protect all callback with netdev instance lock

Protect all ethtool callbacks and PHY related state with the netdev
instance lock, for drivers which want / need to have their ops
instance-locked. Basically take the lock everywhere we take rtnl_lock.
It was tempting to take the lock in ethnl_ops_begin(), but turns
out we actually nest those calls (when generating notifications).

Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Saeed Mahameed <saeed@kernel.org>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250305163732.2766420-11-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/ethtool.c
net/dsa/conduit.c
net/ethtool/cabletest.c
net/ethtool/cmis_fw_update.c
net/ethtool/features.c
net/ethtool/ioctl.c
net/ethtool/module.c
net/ethtool/netlink.c
net/ethtool/phy.c
net/ethtool/rss.c
net/ethtool/tsinfo.c