Skip to content

Commit bec251b

Browse files
Eric Dumazetdavem330
authored andcommitted
net: no longer stop all TX queues in dev_watchdog()
There is no reason for stopping all TX queues from dev_watchdog() Not only this stops feeding the NIC, it also migrates all qdiscs to be serviced on the cpu calling netif_tx_unlock(), causing a potential latency artifact. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dab8fe3 commit bec251b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/sched/sch_generic.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static void dev_watchdog(struct timer_list *t)
500500
{
501501
struct net_device *dev = from_timer(dev, t, watchdog_timer);
502502

503-
netif_tx_lock(dev);
503+
spin_lock(&dev->tx_global_lock);
504504
if (!qdisc_tx_is_noop(dev)) {
505505
if (netif_device_present(dev) &&
506506
netif_running(dev) &&
@@ -523,19 +523,21 @@ static void dev_watchdog(struct timer_list *t)
523523
}
524524
}
525525

526-
if (some_queue_timedout) {
526+
if (unlikely(some_queue_timedout)) {
527527
trace_net_dev_xmit_timeout(dev, i);
528528
WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n",
529529
dev->name, netdev_drivername(dev), i);
530+
netif_freeze_queues(dev);
530531
dev->netdev_ops->ndo_tx_timeout(dev, i);
532+
netif_unfreeze_queues(dev);
531533
}
532534
if (!mod_timer(&dev->watchdog_timer,
533535
round_jiffies(jiffies +
534536
dev->watchdog_timeo)))
535537
dev_hold(dev);
536538
}
537539
}
538-
netif_tx_unlock(dev);
540+
spin_unlock(&dev->tx_global_lock);
539541

540542
dev_put(dev);
541543
}

0 commit comments

Comments
 (0)