Re: [PATCH net-next] net/sched: sch_cake: skip clearing unused tins during rate adjustment
From: Toke Høiland-Jørgensen
Date: Fri Jul 17 2026 - 04:46:04 EST
Jonas Köppeler <j.koeppeler@xxxxxxxxxxxx> writes:
> When cake_configure_rates() is called from the dequeue path with
> rate_adjust=true, it only needs to update the rate parameters. The
> loop that clears the unused tins is both unnecessary and harmful in
> this path:
>
> - cake_clear_tin() overwrites q->cur_tin and q->cur_flow, which are
> actively used by cake_dequeue(), corrupting the dequeue state.
> - iterating over the unused tins and their internal queues to purge
> packets adds needless overhead to the hot path.
>
> Skip the entire loop when rate_adjust is set, as neither
> cake_clear_tin() nor the mtu_time update are needed when only the
> rate changes.
>
> Fixes: 15c2715a5264 ("net/sched: sch_cake: fixup cake_mq rate adjustment for diffserv config")
> Signed-off-by: Jonas Köppeler <j.koeppeler@xxxxxxxxxxxx>
> Tested-by: Mike Pham <mikepham4321@xxxxxxxxx>
Do you have any performance numbers to show the impact of this?
-Toke