tools: ynl: fix spec validation in 6.12.y
Status from this message: Queued the series for 6.12, thanks.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | tools: ynl-gen: use names of constants in generated limitsnet/ tools/ | +25 | 0 replies | |
| 2/4 | tools: ynl-gen: support limits using definitionsDocumentation/ Documentation/ Documentation/ +1 more | +13 | 0 replies | |
| 3/4 | tools: ynl: add scope qualifier for definitionsDocumentation/ Documentation/ Documentation/ +2 more | +65 | 0 replies | |
| 4/4 | doc/netlink: netlink-raw: Add max checkDocumentation/ | +10 | 0 replies |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Joe Damato | Donald Hunter |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | ||
| 3/4 | ||
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 6.12.y 0/4] tools: ynl: fix spec validation in 6.12.y
Two 6.12.y backports added YNL spec features that the 6.12.y YNL tools do not support:
- 6.12.93: a2de9c7f01b3 ("net/handshake: Pass negative errno through handshake_complete()") adds a "scope: kernel" definition to handshake.yaml and uses it in "checks: max";
- 6.12.111: 45ca9f59b6c7 ("net: reject oversized tx_queue_len at netlink parse time") adds "checks: max" to rt_link.yaml, which netlink-raw.yaml does not allow.
Since 6.12.93 "make -C tools/net/ynl" fails on handshake:
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('scope' was unexpected)
and since 6.12.111 the in-tree CLI fails on rt_link:
$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_link.yaml --dump getlink
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('max' was unexpected)Greg queued fbf5df34a4db ("tools: ynl: add scope qualifier for definitions") for newer trees and asked for a 6.12.y backport in
https://lore.kernel.org/all/2026060807-egging-prune-a3ae@gregkh/fbf5df34a4db alone is not enough: handshake.yaml then fails on the constant name in "checks: max", and the 6.12.y generator cannot resolve such names. Patches 1 and 2 add that, patch 3 is fbf5df34a4db. Patch 4 is bf5a54bc0e3d ("doc/netlink: netlink-raw: Add max check"), requested for 6.18.y in
https://lore.kernel.org/all/[email protected]/
Patches 2-4 carry the upstream changes as is; in 6.12.y the generator is tools/net/ynl/ynl-gen-c.py. Patch 1 needed adjustments, they are described in its commit message. Like upstream, it also updates the generated net/core/netdev-genl-gen.c (4294967295ULL -> U32_MAX, 2147483647ULL -> S32_MAX); the object file is byte-identical before and after (x86_64 defconfig).
Tested on top of v6.12.112:
- all 19 specs validate against their schemas (2 fail before);
- make -C tools/net/ynl builds without warnings (fails before);
- tools/net/ynl/ynl-regen.sh -f regenerates all 24 generated kernel and uAPI files with no changes, net/handshake/genl.c included;
- cli.py --spec rt_link.yaml --dump getlink works.
Jakub Kicinski (3):
tools: ynl-gen: use names of constants in generated limits
tools: ynl-gen: support limits using definitions
tools: ynl: add scope qualifier for definitions
Remy D. Farley (1):
doc/netlink: netlink-raw: Add max check
Documentation/netlink/genetlink-c.yaml | 14 ++++- Documentation/netlink/genetlink-legacy.yaml | 14 ++++- Documentation/netlink/genetlink.yaml | 14 ++++- Documentation/netlink/netlink-raw.yaml | 20 +++++- net/core/netdev-genl-gen.c | 4 +- tools/net/ynl/ynl-gen-c.py | 70 ++++++++++++++++----- 6 files changed, 112 insertions(+), 24 deletions(-)
Signature · 1 line
2.47.3