mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
pkt_sched: Use per-queue locking in shutdown_scheduler_queue.
This eliminates another qdisc_lock_tree user. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8a34c5dc3a
commit
17715e62a5
1 changed files with 4 additions and 2 deletions
|
@ -757,18 +757,20 @@ static void shutdown_scheduler_queue(struct net_device *dev,
|
||||||
struct Qdisc *qdisc_default = _qdisc_default;
|
struct Qdisc *qdisc_default = _qdisc_default;
|
||||||
|
|
||||||
if (qdisc) {
|
if (qdisc) {
|
||||||
|
spinlock_t *root_lock = qdisc_root_lock(qdisc);
|
||||||
|
|
||||||
dev_queue->qdisc = qdisc_default;
|
dev_queue->qdisc = qdisc_default;
|
||||||
dev_queue->qdisc_sleeping = qdisc_default;
|
dev_queue->qdisc_sleeping = qdisc_default;
|
||||||
|
|
||||||
|
spin_lock(root_lock);
|
||||||
qdisc_destroy(qdisc);
|
qdisc_destroy(qdisc);
|
||||||
|
spin_unlock(root_lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dev_shutdown(struct net_device *dev)
|
void dev_shutdown(struct net_device *dev)
|
||||||
{
|
{
|
||||||
qdisc_lock_tree(dev);
|
|
||||||
netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
|
netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
|
||||||
shutdown_scheduler_queue(dev, &dev->rx_queue, NULL);
|
shutdown_scheduler_queue(dev, &dev->rx_queue, NULL);
|
||||||
BUG_TRAP(!timer_pending(&dev->watchdog_timer));
|
BUG_TRAP(!timer_pending(&dev->watchdog_timer));
|
||||||
qdisc_unlock_tree(dev);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue