From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D0C934404A; Mon, 13 Apr 2026 21:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776117043; cv=none; b=ncXaP/OpXkg8EasG1uj/nPl2fbFW1gq3+507Xy2GzsIwAqwbRsnCC4Ph8Ys3ZeUchretjaOh7xyRiiOcxT0hfVnlIfE9qWZfqXUOJor25KZTTdeH5PLGdvrIqNZWVB3uptJZ4hQ7svrkYzbzZKii1qtE4uYbFdNmZkDstvcmM8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776117043; c=relaxed/simple; bh=NV9UHlwhuReuD8gNnxIaHmrJEY9DrCjcPy8Iyk8djOs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ge7FfPrw9WMqWgASFKlKGhHiNjw1+GLZtcSKWJvf0oPUda+Vmq8/CMCE1l6CnBNTEsp1Vh4C7jWtJbUOBu/febKuPovZCnBIjCB4c3ROhNfYQvPa4yPnJPIz+dJ33TNdqTums2YXDIIurroW4edzZ7wtHD32G+MNy0LVo9fZm+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uUHIbIS3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uUHIbIS3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E73A5C2BCB3; Mon, 13 Apr 2026 21:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776117042; bh=NV9UHlwhuReuD8gNnxIaHmrJEY9DrCjcPy8Iyk8djOs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uUHIbIS3h7/vYfZLRGdNt0RtiBNQ4C/XAw1QzVFRi4ed2YE6fyQ4YWg7WJL+GK5E3 iN0L72Fktpssk1ajUD+yJ2aUyCqSr1tj2JHlu86W+Dmbv1jZ372U9bpX1gOugqSAOm zvP92tfBpTYmkNe8Zeix7xHsxM64jxAKsfTfn9vSFqgCDNbZ63jSSnuu2tdAXQJfn5 Uup1+ZYs/vkLVdHmiK8wekXEc0QTgxbu5WqamVCbAN8TLAm+wVv2WrJWmOSP7g9Htn gpjDlYct3lkh4sLkqy9i+mgjbHd7rjKmTrRorKJlcylVmzfmyNQfuY8ftXYdxqE9PJ 7gHx0h0YV0SoA== Date: Mon, 13 Apr 2026 14:50:39 -0700 From: Jakub Kicinski To: Mohsin Bashir 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 Message-ID: <20260413145039.43f7b162@kernel.org> In-Reply-To: <20260410225123.2341672-1-mohsin.bashr@gmail.com> References: <20260410225123.2341672-1-mohsin.bashr@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.