tools: ynl: correctly handle overrides of fields in subset
authorJakub Kicinski <kuba@kernel.org>
Tue, 7 Jan 2025 02:28:18 +0000 (18:28 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jan 2025 02:07:52 +0000 (18:07 -0800)
commit69072db934dfc7a566d4eb1fac04146e97ab365f
tree379de79f5eff7701f964682c4e6157ba29e98c43
parentd8c2e5f33acec38cf478c509c65646d029cc378e
tools: ynl: correctly handle overrides of fields in subset

We stated in documentation [1] and previous discussions [2]
that the need for overriding fields in members of subsets
is anticipated. Implement it.

Since each attr is now a new object we need to make sure
that the modifications are propagated. Specifically C codegen
wants to annotate which attrs are used in requests and replies
to generate the right validation artifacts.

[1] https://docs.kernel.org/next/userspace-api/netlink/specs.html#subset-of
[2] https://lore.kernel.org/netdev/20231004171350.1f59cd1d@kernel.org/

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20250107022820.2087101-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/nlspec.py
tools/net/ynl/ynl-gen-c.py