net_sched: sch_htb: defer skb freeing
authorEric Dumazet <edumazet@google.com>
Tue, 14 Jun 2016 03:21:56 +0000 (20:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 21:08:35 +0000 (14:08 -0700)
Both htb_reset() and htb_destroy() can use __qdisc_reset_queue()
instead of __skb_queue_purge() to defer skb freeing of internal
queues.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_htb.c

index 07dcd2933f017eaea35dd159c27c66088ab5c3d5..a454605ab5cbba9a0a6adc2b82fc0f21fc692eab 100644 (file)
@@ -957,7 +957,7 @@ static void htb_reset(struct Qdisc *sch)
                }
        }
        qdisc_watchdog_cancel(&q->watchdog);
-       __skb_queue_purge(&q->direct_queue);
+       __qdisc_reset_queue(&q->direct_queue);
        sch->q.qlen = 0;
        sch->qstats.backlog = 0;
        memset(q->hlevel, 0, sizeof(q->hlevel));
@@ -1231,7 +1231,7 @@ static void htb_destroy(struct Qdisc *sch)
                        htb_destroy_class(sch, cl);
        }
        qdisc_class_hash_destroy(&q->clhash);
-       __skb_queue_purge(&q->direct_queue);
+       __qdisc_reset_queue(&q->direct_queue);
 }
 
 static int htb_delete(struct Qdisc *sch, unsigned long arg)