public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Mohsin Bashir <mohsin.bashr@gmail.com>
Cc: netdev@vger.kernel.org, ast@fiberby.net, chuck.lever@oracle.com,
	davem@davemloft.net, donald.hunter@gmail.com,
	edumazet@google.com, horms@kernel.org,
	linux-kernel@vger.kernel.org, matttbe@kernel.org,
	pabeni@redhat.com
Subject: Re: [PATCH net-next] net: shaper: Reject zero weight in shaper config
Date: Mon, 13 Apr 2026 14:50:39 -0700	[thread overview]
Message-ID: <20260413145039.43f7b162@kernel.org> (raw)
In-Reply-To: <20260410225123.2341672-1-mohsin.bashr@gmail.com>

On Fri, 10 Apr 2026 15:51:23 -0700 Mohsin Bashir wrote:
> A zero weight is meaningless for DWRR scheduling and can cause
> starvation of the affected node. Add a min-value constraint to
> the weight attribute in the net_shaper netlink spec so that zero
> is rejected at the netlink policy level.
> 
> Found while prototyping a new driver, existing drivers are not
> affected.

AI review points out that if the netlink attr is not present core will
leave the DWRR weight as 0 in the struct. I guess we need to think this
thru a little more carefully. What should the "default" weight be?
What if user specifies weights only for subset of leaves?

This part of the uAPI seems under-defined.

Maybe a better adjustment would be to make core set the weight to 1
automatically if the user has not defined it? Only when sending it to
the driver tho, because we'd still want it to not be reported back to
user space. Not sure how hairy it'd get code-wise.

  reply	other threads:[~2026-04-13 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 22:51 [PATCH net-next] net: shaper: Reject zero weight in shaper config Mohsin Bashir
2026-04-13 21:50 ` Jakub Kicinski [this message]
2026-04-14  2:25   ` Mohsin Bashir

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=20260413145039.43f7b162@kernel.org \
    --to=kuba@kernel.org \
    --cc=ast@fiberby.net \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mohsin.bashr@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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