Skip to content

Commit

Permalink
net_sched: make qdisc_reset() smaller
Browse files Browse the repository at this point in the history
For some unknown reason qdisc_reset() is using
a convoluted way of freeing two lists of skbs.

Use __skb_queue_purge() instead.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20220414011004.2378350-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and kuba-moo committed Apr 15, 2022
1 parent 31248b5 commit c9a40d1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,22 +1019,14 @@ EXPORT_SYMBOL(qdisc_create_dflt);
void qdisc_reset(struct Qdisc *qdisc)
{
const struct Qdisc_ops *ops = qdisc->ops;
struct sk_buff *skb, *tmp;

trace_qdisc_reset(qdisc);

if (ops->reset)
ops->reset(qdisc);

skb_queue_walk_safe(&qdisc->gso_skb, skb, tmp) {
__skb_unlink(skb, &qdisc->gso_skb);
kfree_skb_list(skb);
}

skb_queue_walk_safe(&qdisc->skb_bad_txq, skb, tmp) {
__skb_unlink(skb, &qdisc->skb_bad_txq);
kfree_skb_list(skb);
}
__skb_queue_purge(&qdisc->gso_skb);
__skb_queue_purge(&qdisc->skb_bad_txq);

qdisc->q.qlen = 0;
qdisc->qstats.backlog = 0;
Expand Down

0 comments on commit c9a40d1

Please sign in to comment.