OSDN Git Service

etf: Cancel timer if there are no pending skbs
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Thu, 15 Nov 2018 01:26:32 +0000 (17:26 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Nov 2018 04:39:34 +0000 (20:39 -0800)
There is no point in firing the qdisc watchdog if there are no future
skbs pending in the queue and the watchdog had been set previously.

Signed-off-by: Jesus Sanchez-Palencia <jesus.s.palencia@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_etf.c

index 1538d6f..fa85b24 100644 (file)
@@ -117,8 +117,10 @@ static void reset_watchdog(struct Qdisc *sch)
        struct sk_buff *skb = etf_peek_timesortedlist(sch);
        ktime_t next;
 
-       if (!skb)
+       if (!skb) {
+               qdisc_watchdog_cancel(&q->watchdog);
                return;
+       }
 
        next = ktime_sub_ns(skb->tstamp, q->delta);
        qdisc_watchdog_schedule_ns(&q->watchdog, ktime_to_ns(next));