]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - net/sched/sch_generic.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
[thirdparty/kernel/linux.git] / net / sched / sch_generic.c
index 4a2c763e2d116693469e6c8bd9ce0ed8f7f667d9..2a637a17061b91fe8e534823a8b031699bb64f4a 100644 (file)
@@ -506,19 +506,22 @@ static void dev_watchdog(struct timer_list *t)
                        unsigned int timedout_ms = 0;
                        unsigned int i;
                        unsigned long trans_start;
+                       unsigned long oldest_start = jiffies;
 
                        for (i = 0; i < dev->num_tx_queues; i++) {
                                struct netdev_queue *txq;
 
                                txq = netdev_get_tx_queue(dev, i);
                                trans_start = READ_ONCE(txq->trans_start);
-                               if (netif_xmit_stopped(txq) &&
-                                   time_after(jiffies, (trans_start +
-                                                        dev->watchdog_timeo))) {
+                               if (!netif_xmit_stopped(txq))
+                                       continue;
+                               if (time_after(jiffies, trans_start + dev->watchdog_timeo)) {
                                        timedout_ms = jiffies_to_msecs(jiffies - trans_start);
                                        atomic_long_inc(&txq->trans_timeout);
                                        break;
                                }
+                               if (time_after(oldest_start, trans_start))
+                                       oldest_start = trans_start;
                        }
 
                        if (unlikely(timedout_ms)) {
@@ -531,7 +534,7 @@ static void dev_watchdog(struct timer_list *t)
                                netif_unfreeze_queues(dev);
                        }
                        if (!mod_timer(&dev->watchdog_timer,
-                                      round_jiffies(jiffies +
+                                      round_jiffies(oldest_start +
                                                     dev->watchdog_timeo)))
                                release = false;
                }
@@ -945,7 +948,9 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
        __skb_queue_head_init(&sch->gso_skb);
        __skb_queue_head_init(&sch->skb_bad_txq);
        gnet_stats_basic_sync_init(&sch->bstats);
+       lockdep_register_key(&sch->root_lock_key);
        spin_lock_init(&sch->q.lock);
+       lockdep_set_class(&sch->q.lock, &sch->root_lock_key);
 
        if (ops->static_flags & TCQ_F_CPUSTATS) {
                sch->cpu_bstats =
@@ -980,6 +985,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 
        return sch;
 errout1:
+       lockdep_unregister_key(&sch->root_lock_key);
        kfree(sch);
 errout:
        return ERR_PTR(err);
@@ -1068,6 +1074,7 @@ static void __qdisc_destroy(struct Qdisc *qdisc)
        if (ops->destroy)
                ops->destroy(qdisc);
 
+       lockdep_unregister_key(&qdisc->root_lock_key);
        module_put(ops->owner);
        netdev_put(dev, &qdisc->dev_tracker);