DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Megha Ajmera <megha.ajmera@intel.com>
Cc: jasvinder.singh@intel.com, dev@dpdk.org
Subject: Re: [PATCH] sched: fix wrr parameter data type
Date: Thu, 18 Sep 2025 08:51:45 -0700	[thread overview]
Message-ID: <20250918085145.584fca13@hermes.local> (raw)
In-Reply-To: <20250918024609.2027038-1-megha.ajmera@intel.com>

On Thu, 18 Sep 2025 08:16:09 +0530
Megha Ajmera <megha.ajmera@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@intel.com>
> Acked-by: Jasvinder Singh <Jasvinder.singh@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@networkplumber.org>



  reply	other threads:[~2025-09-18 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18  2:46 Megha Ajmera
2025-09-18 15:51 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-21 12:47 Megha Ajmera
2025-02-21 13:02 ` Singh, Jasvinder
2025-02-21 19:14 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250918085145.584fca13@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=megha.ajmera@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).