From: Jesus Sanchez-Palencia Date: Thu, 15 Nov 2018 01:26:32 +0000 (-0800) Subject: etf: Cancel timer if there are no pending skbs X-Git-Tag: for-4.21~11^2~285 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3fcbdaee3b5c4a7f8ea4c7c11fecc009d2a1e7e4;p=uclinux-h8%2Flinux.git etf: Cancel timer if there are no pending skbs 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c index 1538d6fa8165..fa85b24ac794 100644 --- a/net/sched/sch_etf.c +++ b/net/sched/sch_etf.c @@ -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));