Re: [PATCH net-next] net: shaper: Reject zero weight in shaper config
From: Mohsin Bashir
Date: Mon Apr 13 2026 - 22:26:17 EST
On 4/13/26 2:50 PM, Jakub Kicinski wrote:
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.
Interesting!!
Let me look at the big picture here and re-spin.