Skip to content

Commit 342debc

Browse files
congwangPaolo Abeni
authored andcommitted
codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
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>
1 parent a7a15f3 commit 342debc

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
@@ -65,10 +65,7 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch)
6565
&q->stats, qdisc_pkt_len, codel_get_enqueue_time,
6666
drop_func, dequeue_func);
6767

68-
/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
69-
* or HTB crashes. Defer it for next round.
70-
*/
71-
if (q->stats.drop_count && sch->q.qlen) {
68+
if (q->stats.drop_count) {
7269
qdisc_tree_reduce_backlog(sch, q->stats.drop_count, q->stats.drop_len);
7370
q->stats.drop_count = 0;
7471
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)