Skip to content

Commit 7a742a9

Browse files
congwanggregkh
authored andcommitted
codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
commit 342debc upstream. After making all ->qlen_notify() callbacks idempotent, now it is safe to remove the check of qlen!=0 from both fq_codel_dequeue() and codel_qdisc_dequeue(). Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg> Fixes: 4b549a2 ("fq_codel: Fair Queue Codel AQM") Fixes: 76e3cc1 ("codel: Controlled Delay AQM") Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250403211636.166257-1-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4f9cd31 commit 7a742a9

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

net/sched/sch_codel.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch)
9595
&q->stats, qdisc_pkt_len, codel_get_enqueue_time,
9696
drop_func, dequeue_func);
9797

98-
/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
99-
* or HTB crashes. Defer it for next round.
100-
*/
101-
if (q->stats.drop_count && sch->q.qlen) {
98+
if (q->stats.drop_count) {
10299
qdisc_tree_reduce_backlog(sch, q->stats.drop_count, q->stats.drop_len);
103100
q->stats.drop_count = 0;
104101
q->stats.drop_len = 0;

net/sched/sch_fq_codel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,8 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
315315
}
316316
qdisc_bstats_update(sch, skb);
317317
flow->deficit -= qdisc_pkt_len(skb);
318-
/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
319-
* or HTB crashes. Defer it for next round.
320-
*/
321-
if (q->cstats.drop_count && sch->q.qlen) {
318+
319+
if (q->cstats.drop_count) {
322320
qdisc_tree_reduce_backlog(sch, q->cstats.drop_count,
323321
q->cstats.drop_len);
324322
q->cstats.drop_count = 0;

0 commit comments

Comments
 (0)