Skip to content

Commit e73c838

Browse files
congwanggregkh
authored andcommitted
codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
[ Upstream commit 342debc ] 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: Sasha Levin <sashal@kernel.org>
1 parent d0e02d3 commit e73c838

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
@@ -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
@@ -314,10 +314,8 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
314314
}
315315
qdisc_bstats_update(sch, skb);
316316
flow->deficit -= qdisc_pkt_len(skb);
317-
/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
318-
* or HTB crashes. Defer it for next round.
319-
*/
320-
if (q->cstats.drop_count && sch->q.qlen) {
317+
318+
if (q->cstats.drop_count) {
321319
qdisc_tree_reduce_backlog(sch, q->cstats.drop_count,
322320
q->cstats.drop_len);
323321
q->cstats.drop_count = 0;

0 commit comments

Comments
 (0)