netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] tools: ynl-gen: support sub-messages and rt-link
@ 2025-05-15 23:16 Jakub Kicinski
  2025-05-15 23:16 ` [PATCH net-next 1/9] netlink: specs: rt-link: add C naming info for ovpn Jakub Kicinski
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Jakub Kicinski @ 2025-05-15 23:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, donald.hunter,
	daniel, nicolas.dichtel, jacob.e.keller, Jakub Kicinski

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

-- 
2.49.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-05-20  8:28 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15 23:16 [PATCH net-next 0/9] tools: ynl-gen: support sub-messages and rt-link Jakub Kicinski
2025-05-15 23:16 ` [PATCH net-next 1/9] netlink: specs: rt-link: add C naming info for ovpn Jakub Kicinski
2025-05-16  9:08   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 2/9] tools: ynl-gen: factor out the annotation of pure nested struct Jakub Kicinski
2025-05-16  9:57   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 3/9] tools: ynl-gen: prepare for submsg structs Jakub Kicinski
2025-05-16 10:15   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 4/9] tools: ynl-gen: submsg: plumb thru an empty type Jakub Kicinski
2025-05-16 10:20   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 5/9] tools: ynl-gen: submsg: render the structs Jakub Kicinski
2025-05-16 10:31   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 6/9] tools: ynl-gen: submsg: support parsing and rendering sub-messages Jakub Kicinski
2025-05-16 10:43   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 7/9] tools: ynl: submsg: reverse parse / error reporting Jakub Kicinski
2025-05-16 10:58   ` Donald Hunter
2025-05-15 23:16 ` [PATCH net-next 8/9] tools: ynl: enable codegen for all rt- families Jakub Kicinski
2025-05-16 11:00   ` Donald Hunter
2025-05-19 14:49   ` Kory Maincent
2025-05-19 15:57     ` Jakub Kicinski
2025-05-20  8:28       ` Kory Maincent
2025-05-15 23:16 ` [PATCH net-next 9/9] tools: ynl: add a sample for rt-link Jakub Kicinski
2025-05-16 11:40   ` Donald Hunter
2025-05-16 23:40 ` [PATCH net-next 0/9] tools: ynl-gen: support sub-messages and rt-link patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).