net: sched: don't recurse on the netdev ops lock in qdiscs

cbs_set_port_rate() and taprio_set_picos_per_byte() are reached from
two paths and both already hold the device's ops lock:

 *_change(), via tc_modify_qdisc() which calls netdev_lock_ops(dev)
    before dispatching to the qdisc ops.

 *_dev_notifier() on NETDEV_UP / NETDEV_CHANGE, where caller
    holds the ops lock across the notifier chain.

Switch to netif_get_link_ksettings() to avoid deadlock once
__ethtool_get_link_ksettings() starts taking the netdev lock.

Link: https://patch.msgid.link/20260603012840.2254293-9-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2026-06-02 18:28:37 -07:00
parent 20398c41d0
commit e50f6245be
2 changed files with 2 additions and 2 deletions

View File

@ -327,7 +327,7 @@ static void cbs_set_port_rate(struct net_device *dev, struct cbs_sched_data *q)
s64 port_rate;
int err;
err = __ethtool_get_link_ksettings(dev, &ecmd);
err = netif_get_link_ksettings(dev, &ecmd);
if (err < 0)
goto skip;

View File

@ -1299,7 +1299,7 @@ static void taprio_set_picos_per_byte(struct net_device *dev,
int picos_per_byte;
int err;
err = __ethtool_get_link_ksettings(dev, &ecmd);
err = netif_get_link_ksettings(dev, &ecmd);
if (err < 0)
goto skip;