Commit 3fcbdaee authored by Jesus Sanchez-Palencia's avatar Jesus Sanchez-Palencia Committed by David S. Miller

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: default avatarJesus Sanchez-Palencia <jesus.s.palencia@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 213d7767
...@@ -117,8 +117,10 @@ static void reset_watchdog(struct Qdisc *sch) ...@@ -117,8 +117,10 @@ static void reset_watchdog(struct Qdisc *sch)
struct sk_buff *skb = etf_peek_timesortedlist(sch); struct sk_buff *skb = etf_peek_timesortedlist(sch);
ktime_t next; ktime_t next;
if (!skb) if (!skb) {
qdisc_watchdog_cancel(&q->watchdog);
return; return;
}
next = ktime_sub_ns(skb->tstamp, q->delta); next = ktime_sub_ns(skb->tstamp, q->delta);
qdisc_watchdog_schedule_ns(&q->watchdog, ktime_to_ns(next)); qdisc_watchdog_schedule_ns(&q->watchdog, ktime_to_ns(next));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment