mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
sch_ets: make est_qlen_notify() idempotent
est_qlen_notify() deletes its class from its active list with list_del() when qlen is 0, therefore, it is not idempotent and not friendly to its callers, like fq_codel_dequeue(). Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers' life. Also change other list_del()'s to list_del_init() just to be extra safe. Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Link: https://patch.msgid.link/20250403211033.166059-6-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
55f9eca4bf
commit
a7a15f39c6
|
|
@ -293,7 +293,7 @@ static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg)
|
|||
* to remove them.
|
||||
*/
|
||||
if (!ets_class_is_strict(q, cl) && sch->q.qlen)
|
||||
list_del(&cl->alist);
|
||||
list_del_init(&cl->alist);
|
||||
}
|
||||
|
||||
static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
|
||||
|
|
@ -488,7 +488,7 @@ static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
|
|||
if (unlikely(!skb))
|
||||
goto out;
|
||||
if (cl->qdisc->q.qlen == 0)
|
||||
list_del(&cl->alist);
|
||||
list_del_init(&cl->alist);
|
||||
return ets_qdisc_dequeue_skb(sch, skb);
|
||||
}
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
|
|||
}
|
||||
for (i = q->nbands; i < oldbands; i++) {
|
||||
if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
|
||||
list_del(&q->classes[i].alist);
|
||||
list_del_init(&q->classes[i].alist);
|
||||
qdisc_tree_flush_backlog(q->classes[i].qdisc);
|
||||
}
|
||||
WRITE_ONCE(q->nstrict, nstrict);
|
||||
|
|
@ -713,7 +713,7 @@ static void ets_qdisc_reset(struct Qdisc *sch)
|
|||
|
||||
for (band = q->nstrict; band < q->nbands; band++) {
|
||||
if (q->classes[band].qdisc->q.qlen)
|
||||
list_del(&q->classes[band].alist);
|
||||
list_del_init(&q->classes[band].alist);
|
||||
}
|
||||
for (band = 0; band < q->nbands; band++)
|
||||
qdisc_reset(q->classes[band].qdisc);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user