Skip to content

tools: ynl-gen: support sub-messages and rt-link

Jakub Kicinski bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 12 repliesIn review 7 of 9 applied

Patches in v1 7 of 9 applied

#Subject and filesSizeRepliesApplied
1/9netlink: specs: rt-link: add C naming info for ovpnDocumentation/netlink/specs/rt-link.yaml+4 -01 replyApplied
2/9tools: ynl-gen: factor out the annotation of pure nested structtools/net/ynl/pyynl/ynl_gen_c.py+22 -171 replyApplied
3/9tools: ynl-gen: prepare for submsg structstools/net/ynl/pyynl/ynl_gen_c.py+39 -231 replyApplied
4/9tools: ynl-gen: submsg: plumb thru an empty typetools/net/ynl/pyynl/lib/__init__.py tools/net/ynl/pyynl/ynl_gen_c.py+23 -21 replyApplied
5/9tools: ynl-gen: submsg: render the structstools/net/ynl/pyynl/ynl_gen_c.py+43 -31 replyApplied
6/9tools: ynl-gen: submsg: support parsing and rendering sub-messagestools/net/ynl/lib/ynl-priv.h tools/net/ynl/lib/ynl.c tools/net/ynl/lib/ynl.h +1 more+89 -41 reply
7/9tools: ynl: submsg: reverse parse / error reportingtools/net/ynl/lib/ynl-priv.h tools/net/ynl/lib/ynl.c tools/net/ynl/pyynl/ynl_gen_c.py+107 -111 replyApplied
8/9tools: ynl: enable codegen for all rt- familiestools/net/ynl/Makefile.deps tools/net/ynl/generated/Makefile+7 -44 repliesApplied
9/9tools: ynl: add a sample for rt-linktools/net/ynl/samples/.gitignore tools/net/ynl/samples/rt-link.c+185 -01 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchDonald Hunter
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/9] tools: ynl-gen: support sub-messages and rt-link

Sub-messages are how we express "polymorphism" in YNL. Donald added the support to specs and Python a while back, support them in C, too. Sub-message is a nest, but the interpretation of the attribute types within that nest depends on a value of another attribute. For example in rt-link the "kind" attribute contains the link type (veth, bonding, etc.) and based on that the right enum has to be applied to interpret link-specific attributes.

The last message is probably the most interesting to look at, as it adds a fairly advanced sample.

This patch only contains enough support for rtnetlink, we will need a little more complexity to support TC, where sub-messages may contain fixed headers, and where the selector may be in a different nest than the submessage.

Jakub Kicinski (9):
netlink: specs: rt-link: add C naming info for ovpn
tools: ynl-gen: factor out the annotation of pure nested struct
tools: ynl-gen: prepare for submsg structs
tools: ynl-gen: submsg: plumb thru an empty type
tools: ynl-gen: submsg: render the structs
tools: ynl-gen: submsg: support parsing and rendering sub-messages
tools: ynl: submsg: reverse parse / error reporting
tools: ynl: enable codegen for all rt- families
tools: ynl: add a sample for rt-link

 Documentation/netlink/specs/rt-link.yaml |   4 +
 tools/net/ynl/Makefile.deps              |   4 +
 tools/net/ynl/generated/Makefile         |   7 +-
 tools/net/ynl/lib/ynl-priv.h             |   8 +-
 tools/net/ynl/lib/ynl.h                  |   1 +
 tools/net/ynl/lib/ynl.c                  |  93 +++++++-
 tools/net/ynl/samples/rt-link.c          | 184 +++++++++++++++
 tools/net/ynl/pyynl/lib/__init__.py      |   5 +-
 tools/net/ynl/pyynl/ynl_gen_c.py         | 272 +++++++++++++++++++----
 tools/net/ynl/samples/.gitignore         |   1 +
 10 files changed, 517 insertions(+), 62 deletions(-)
 create mode 100644 tools/net/ynl/samples/rt-link.c
Signature · 1 line
2.49.0