]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/sched: sch_cake: avoid sync overhead when unlimited
authorJonas Köppeler <j.koeppeler@tu-berlin.de>
Thu, 26 Feb 2026 11:40:15 +0000 (12:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 28 Feb 2026 02:35:40 +0000 (18:35 -0800)
Skip inter-instance sync when no rate limit is configured, as it serves
no purpose and only adds overhead.

Fixes: 1bddd758bac2 ("net/sched: sch_cake: share shaper state across sub-instances of cake_mq")
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260226-cake-mq-skip-sync-bandwidth-unlimited-v1-1-01830bb4db87@tu-berlin.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_cake.c

index a01f14b1c21629c933601c950d05703d91c88e8c..b23fc7d9fafe53e32c1930f4ecb89e77cc280244 100644 (file)
@@ -2013,7 +2013,8 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
        u64 delay;
        u32 len;
 
-       if (q->config->is_shared && now - q->last_checked_active >= q->config->sync_time) {
+       if (q->config->is_shared && q->rate_ns &&
+           now - q->last_checked_active >= q->config->sync_time) {
                struct net_device *dev = qdisc_dev(sch);
                struct cake_sched_data *other_priv;
                u64 new_rate = q->config->rate_bps;