linux-next/net/shaper
Paolo Abeni ecd82cfee3 net-shapers: implement cap validation in the core
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>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Link: https://patch.msgid.link/54667601813e4c0348f39bf8ad2446ffc9fcd383.1728460186.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-10-10 08:30:23 -07:00
..
Makefile netlink: spec: add shaper YAML spec 2024-10-10 08:30:21 -07:00
shaper_nl_gen.c netlink: spec: add shaper introspection support 2024-10-10 08:30:22 -07:00
shaper_nl_gen.h netlink: spec: add shaper introspection support 2024-10-10 08:30:22 -07:00
shaper.c net-shapers: implement cap validation in the core 2024-10-10 08:30:23 -07:00