]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 3 Apr 2025 21:16:31 +0000 (14:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:06 +0000 (10:15 +0200)
[ Upstream commit 342debc12183b51773b3345ba267e9263bdfaaef ]

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: 4b549a2ef4be ("fq_codel: Fair Queue Codel AQM")
Fixes: 76e3cc126bb2 ("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>
net/sched/sch_codel.c
net/sched/sch_fq_codel.c

index 3e8d4fe4d91e3ef2b7715640f6675aa5e8e2a326..e1f6e7618debd4ed2974751f79777e8e21969c78 100644 (file)
@@ -65,10 +65,7 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch)
                            &q->stats, qdisc_pkt_len, codel_get_enqueue_time,
                            drop_func, dequeue_func);
 
-       /* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
-        * or HTB crashes. Defer it for next round.
-        */
-       if (q->stats.drop_count && sch->q.qlen) {
+       if (q->stats.drop_count) {
                qdisc_tree_reduce_backlog(sch, q->stats.drop_count, q->stats.drop_len);
                q->stats.drop_count = 0;
                q->stats.drop_len = 0;
index 4f908c11ba9528f8f9f3af6752ff10005d6f6511..778f6e5966be80a90b23041fc7655276db0741cf 100644 (file)
@@ -314,10 +314,8 @@ begin:
        }
        qdisc_bstats_update(sch, skb);
        flow->deficit -= qdisc_pkt_len(skb);
-       /* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
-        * or HTB crashes. Defer it for next round.
-        */
-       if (q->cstats.drop_count && sch->q.qlen) {
+
+       if (q->cstats.drop_count) {
                qdisc_tree_reduce_backlog(sch, q->cstats.drop_count,
                                          q->cstats.drop_len);
                q->cstats.drop_count = 0;