From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinicius Costa Gomes Subject: [PATCH net-next v1 1/4] etf: Cancel timer if there are no pending skbs Date: Wed, 14 Nov 2018 17:26:32 -0800 Message-ID: <20181115012635.7272-1-vinicius.gomes@intel.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Jesus Sanchez-Palencia , jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, jesus.s.palencia@gmail.com, ilias.apalodimas@linaro.org To: netdev@vger.kernel.org Return-path: Received: from mga18.intel.com ([134.134.136.126]:32131 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbeKOLdS (ORCPT ); Thu, 15 Nov 2018 06:33:18 -0500 Sender: netdev-owner@vger.kernel.org List-ID: From: Jesus Sanchez-Palencia 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 --- net/sched/sch_etf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- 2.19.1