aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/ethtool.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-03-05 16:37:28 +0000
committerJakub Kicinski <[email protected]>2025-03-06 20:59:44 +0000
commit2bcf4772e45adb00649a4e9cbff14b08a144f9e3 (patch)
tree3f9472a249e9d7ee3141be0bba0b8c53bf3a6b82 /drivers/net/netdevsim/ethtool.c
parentnet: hold netdev instance lock during ndo_bpf (diff)
downloadkernel-2bcf4772e45adb00649a4e9cbff14b08a144f9e3.tar.gz
kernel-2bcf4772e45adb00649a4e9cbff14b08a144f9e3.zip
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 <[email protected]> Cc: Saeed Mahameed <[email protected]> Signed-off-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netdevsim/ethtool.c')
-rw-r--r--drivers/net/netdevsim/ethtool.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index 7ab358616e03..4d191a3293c7 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -107,10 +107,8 @@ nsim_set_channels(struct net_device *dev, struct ethtool_channels *ch)
struct netdevsim *ns = netdev_priv(dev);
int err;
- netdev_lock(dev);
err = netif_set_real_num_queues(dev, ch->combined_count,
ch->combined_count);
- netdev_unlock(dev);
if (err)
return err;