Subject: Re: [PATCH net] net/sched: ets: fix divide by zero in the offload path

From: Petr Machata <[email-masked]>
Date: Wed, 25 Feb 2026 18:23:13 +0100

Davide Caratti <[email-masked]> writes:

> Offloading ETS requires computing each class' WRR weight: this is done by
> averaging over the sums of quanta as 'q_sum' and 'q_psum'. Using unsigned
> int, the same integer size as the individual DRR quanta, can overflow and
> even cause division by zero, like it happened in the following splat:

...

> Fix this using 64-bit integers for 'q_sum' and 'q_psum'.
>
> Cc: [email-masked]
> Fixes: d35eb52bd2ac ("net: sch_ets: Make the ETS qdisc offloadable")
> Signed-off-by: Davide Caratti <[email-masked]>

Thanks for the fix!

Reviewed-by: Petr Machata <[email-masked]>