[PATCH] sched: fix wrr parameter data type
Thomas Monjalon
thomas at monjalon.net
Thu Oct 23 19:40:04 CEST 2025
18/09/2025 17:51, Stephen Hemminger:
> On Thu, 18 Sep 2025 08:16:09 +0530
> Megha Ajmera <megha.ajmera at intel.com> wrote:
>
> > wrr tokens getting truncated to uint8_t in wrr_store function() due to
> > type mismatch. This patch changes the data type to uint16_t.
> >
> > Fixes: e16b06da0908 ("sched: remove WRR from strict priority TC queues")
> >
> > Signed-off-by: Megha Ajmera <megha.ajmera at intel.com>
> > Acked-by: Jasvinder Singh <Jasvinder.singh at intel.com>
>
> The pipe tokens are updated in grinder_wrr_store by:
>
> pipe->wrr_tokens[0] =
> (grinder->wrr_tokens[0] & grinder->wrr_mask[0]) >>
> RTE_SCHED_WRR_SHIFT;
>
> The token in rte_sched_grinder is uint16_t.
> The mask value in wrr_mask is either 0 or 0xffff.
> The shift is 3.
> Therefore the range of pipe tokens is 0xffff >> 3 = 1FFF
>
> The sched code is severely under commented and overly complex.
> The patch looks right.
>
> Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Cc stable
Applied, thanks.
More information about the dev
mailing list