net: ethtool: optionally skip rtnl_lock in ethnl_act_module_fw_flash()

Module firmware flashing reads SFF-8024 identifier bytes via
.get_module_eeprom_by_page(). Other than that it modifies
a bit in the netdev->ethtool struct. Both should be ops-locked
at this point.

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-9-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski
2026-06-04 17:29:08 -07:00
parent 0c334c21f5
commit 2526717624
2 changed files with 3 additions and 5 deletions

View File

@@ -2584,7 +2584,7 @@ struct net_device {
* @up, @moving_ns, @nd_net, @xdp_features
*
* Ops protects:
* @cfg, @cfg_pending, @hwprov
* @cfg, @cfg_pending, @ethtool, @hwprov
*
* Double ops protects:
* @real_num_rx_queues, @real_num_tx_queues

View File

@@ -429,8 +429,7 @@ int ethnl_act_module_fw_flash(struct sk_buff *skb, struct genl_info *info)
return ret;
dev = req_info.dev;
rtnl_lock();
netdev_lock_ops(dev);
netdev_lock_ops_compat(dev);
ret = ethnl_ops_begin(dev);
if (ret < 0)
goto out_unlock;
@@ -445,8 +444,7 @@ int ethnl_act_module_fw_flash(struct sk_buff *skb, struct genl_info *info)
ethnl_ops_complete(dev);
out_unlock:
netdev_unlock_ops(dev);
rtnl_unlock();
netdev_unlock_ops_compat(dev);
ethnl_parse_header_dev_put(&req_info);
return ret;
}