Skip to content

Commit 526fc9d

Browse files
congwangpaniakin-aws
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: Maximilian Heyne <mheyne@amazon.de>
1 parent e0aea48 commit 526fc9d

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

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
@@ -326,10 +326,8 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
326326
}
327327
qdisc_bstats_update(sch, skb);
328328
flow->deficit -= qdisc_pkt_len(skb);
329-
/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
330-
* or HTB crashes. Defer it for next round.
331-
*/
332-
if (q->cstats.drop_count && sch->q.qlen) {
329+
330+
if (q->cstats.drop_count) {
333331
qdisc_tree_reduce_backlog(sch, q->cstats.drop_count,
334332
q->cstats.drop_len);
335333
q->cstats.drop_count = 0;

0 commit comments

Comments
 (0)