Re: [PATCH v6 net-next 10/15] net-shapers: implement cap validation in the core

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-09-05 01:56:08
Also in
intel-wired-lan
Reply to
Paolo Abeni, 2024-09-04
On Wed,  4 Sep 2024 15:53:42 +0200 Paolo Abeni wrote:
Use the device capabilities to reject invalid attribute values before
pushing them to the H/W.

Note that validating the metric explicitly avoids NL_SET_BAD_ATTR()
usage, to provide unambiguous error messages to the user.

Validating the nesting requires the knowledge of the new parent for
the given shaper; as such is a chicken-egg problem: to validate the
leaf nesting we need to know the node scope, to validate the node
nesting we need to know the leafs parent scope.

To break the circular dependency, place the leafs nesting validation
after the parsing.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Thread (32 messages) 32 messages, 2 authors, last reply 2024-09-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help