netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/8] tools: ynl-gen: fill in the gaps in support of legacy families
@ 2023-12-13 23:14 Jakub Kicinski
  2023-12-13 23:14 ` [PATCH net-next 1/8] tools: ynl-gen: add missing request free helpers for dumps Jakub Kicinski
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Jakub Kicinski @ 2023-12-13 23:14 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, nicolas.dichtel, jiri, donald.hunter,
	Jakub Kicinski

Fill in the gaps in YNL C code gen so that we can generate user
space code for all genetlink families for which we have specs.

The two major changes we need are support for fixed headers and
support for recursive nests.

For fixed header support - place the struct for the fixed header
directly in the request struct (and don't bother generating access
helpers). The member of a fixed header can't be too complex, and
also are by definition not optional so the user has to fill them in.
The YNL core needs a bit of a tweak to understand that the attrs
may now start at a fixed offset, which is not necessarily equal
to sizeof(struct genlmsghdr).

Dealing with nested sets is much harder. Previously we'd gen
the nested structs as:

 struct outer {
   struct inner inner;
 };

If structs are recursive (e.g. inner contains outer again)
we must break this chain and allocate one of the structs
dynamically (store a pointer rather than full struct).

Jakub Kicinski (8):
  tools: ynl-gen: add missing request free helpers for dumps
  tools: ynl-gen: use enum user type for members and args
  tools: ynl-gen: support fixed headers in genetlink
  tools: ynl-gen: fill in implementations for TypeUnused
  tools: ynl-gen: record information about recursive nests
  tools: ynl-gen: re-sort ignoring recursive nests
  tools: ynl-gen: store recursive nests by a pointer
  tools: ynl-gen: print prototypes for recursive stuff

 tools/net/ynl/lib/ynl.c    |   8 +-
 tools/net/ynl/lib/ynl.h    |   1 +
 tools/net/ynl/ynl-gen-c.py | 190 +++++++++++++++++++++++++++++--------
 3 files changed, 158 insertions(+), 41 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2023-12-15  2:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 23:14 [PATCH net-next 0/8] tools: ynl-gen: fill in the gaps in support of legacy families Jakub Kicinski
2023-12-13 23:14 ` [PATCH net-next 1/8] tools: ynl-gen: add missing request free helpers for dumps Jakub Kicinski
2023-12-14 10:21   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 2/8] tools: ynl-gen: use enum user type for members and args Jakub Kicinski
2023-12-14 10:26   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 3/8] tools: ynl-gen: support fixed headers in genetlink Jakub Kicinski
2023-12-14 10:57   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 4/8] tools: ynl-gen: fill in implementations for TypeUnused Jakub Kicinski
2023-12-14 10:58   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 5/8] tools: ynl-gen: record information about recursive nests Jakub Kicinski
2023-12-14 11:02   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 6/8] tools: ynl-gen: re-sort ignoring " Jakub Kicinski
2023-12-14 11:12   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 7/8] tools: ynl-gen: store recursive nests by a pointer Jakub Kicinski
2023-12-14 11:11   ` Donald Hunter
2023-12-13 23:14 ` [PATCH net-next 8/8] tools: ynl-gen: print prototypes for recursive stuff Jakub Kicinski
2023-12-14 11:11   ` Donald Hunter
2023-12-15  2:01 ` [PATCH net-next 0/8] tools: ynl-gen: fill in the gaps in support of legacy families 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).