Skip to content

Commit 4909dab

Browse files
congwangdavem330
authored andcommitted
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 <[email protected]> Cc: Jiri Pirko <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b3037ac commit 4909dab

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

net/sched/sch_generic.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -949,32 +949,22 @@ static void qdisc_free_cb(struct rcu_head *head)
949949
static void qdisc_destroy(struct Qdisc *qdisc)
950950
{
951951
const struct Qdisc_ops *ops = qdisc->ops;
952-
struct sk_buff *skb, *tmp;
953952

954953
#ifdef CONFIG_NET_SCHED
955954
qdisc_hash_del(qdisc);
956955

957956
qdisc_put_stab(rtnl_dereference(qdisc->stab));
958957
#endif
959958
gen_kill_estimator(&qdisc->rate_est);
960-
if (ops->reset)
961-
ops->reset(qdisc);
959+
960+
qdisc_reset(qdisc);
961+
962962
if (ops->destroy)
963963
ops->destroy(qdisc);
964964

965965
module_put(ops->owner);
966966
dev_put(qdisc_dev(qdisc));
967967

968-
skb_queue_walk_safe(&qdisc->gso_skb, skb, tmp) {
969-
__skb_unlink(skb, &qdisc->gso_skb);
970-
kfree_skb_list(skb);
971-
}
972-
973-
skb_queue_walk_safe(&qdisc->skb_bad_txq, skb, tmp) {
974-
__skb_unlink(skb, &qdisc->skb_bad_txq);
975-
kfree_skb_list(skb);
976-
}
977-
978968
call_rcu(&qdisc->rcu, qdisc_free_cb);
979969
}
980970

0 commit comments

Comments
 (0)