mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
net: warn ops-locked drivers still using ndo_set_rx_mode
Now that all in-tree ops-locked drivers have been converted to ndo_set_rx_mode_async, add a warning in register_netdevice to catch any remaining or newly added drivers that use ndo_set_rx_mode with ops locking. This ensures future driver authors are guided toward the async path. Also route ops-locked devices through netdev_rx_mode_work even if they lack rx_mode NDOs, to ensure netdev_ops_assert_locked() does not fire on the legacy path where only RTNL is held. Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20260416185712.2155425-14-sdf@fomichev.me Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
754b7e1169
commit
3cbd229388
|
|
@ -11360,6 +11360,11 @@ int register_netdevice(struct net_device *dev)
|
|||
goto err_uninit;
|
||||
}
|
||||
|
||||
if (netdev_need_ops_lock(dev) &&
|
||||
dev->netdev_ops->ndo_set_rx_mode &&
|
||||
!dev->netdev_ops->ndo_set_rx_mode_async)
|
||||
netdev_WARN(dev, "ops-locked drivers should use ndo_set_rx_mode_async\n");
|
||||
|
||||
ret = netdev_do_alloc_pcpu_stats(dev);
|
||||
if (ret)
|
||||
goto err_uninit;
|
||||
|
|
|
|||
|
|
@ -1370,7 +1370,8 @@ void __dev_set_rx_mode(struct net_device *dev)
|
|||
if (!netif_device_present(dev))
|
||||
return;
|
||||
|
||||
if (ops->ndo_set_rx_mode_async || ops->ndo_change_rx_flags) {
|
||||
if (ops->ndo_set_rx_mode_async || ops->ndo_change_rx_flags ||
|
||||
netdev_need_ops_lock(dev)) {
|
||||
netif_rx_mode_queue(dev);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user