diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2020-05-26 21:35:23 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-27 15:05:49 -0700 |
commit | 4909daba37846317ec7dcba16fba009636f7fe21 (patch) | |
tree | 0d75254b656da561bf38f52b12b9c65c1f4b5341 /net/sched | |
parent | b3037ac50130a169c3980e63f8df2f0b599db411 (diff) | |
download | linux-4909daba37846317ec7dcba16fba009636f7fe21.tar.gz linux-4909daba37846317ec7dcba16fba009636f7fe21.tar.bz2 linux-4909daba37846317ec7dcba16fba009636f7fe21.zip |
net_sched: use qdisc_reset() in qdisc_destroy()
qdisc_destroy() calls ops->reset() and cleans up qdisc->gso_skb
and qdisc->skb_bad_txq, these are nearly same with qdisc_reset(),
so just call it directly, and cosolidate the code for the next
patch.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_generic.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index ebc55d884247..7a0b06001e48 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -949,7 +949,6 @@ static void qdisc_free_cb(struct rcu_head *head) static void qdisc_destroy(struct Qdisc *qdisc) { const struct Qdisc_ops *ops = qdisc->ops; - struct sk_buff *skb, *tmp; #ifdef CONFIG_NET_SCHED qdisc_hash_del(qdisc); @@ -957,24 +956,15 @@ static void qdisc_destroy(struct Qdisc *qdisc) qdisc_put_stab(rtnl_dereference(qdisc->stab)); #endif gen_kill_estimator(&qdisc->rate_est); - if (ops->reset) - ops->reset(qdisc); + + qdisc_reset(qdisc); + if (ops->destroy) ops->destroy(qdisc); module_put(ops->owner); dev_put(qdisc_dev(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); - } - call_rcu(&qdisc->rcu, qdisc_free_cb); } |