]> www.infradead.org Git - users/dwmw2/linux.git/commit
Merge branch 'tools-ynl-gen-fill-in-the-gaps-in-support-of-legacy-families'
authorJakub Kicinski <kuba@kernel.org>
Fri, 15 Dec 2023 01:51:23 +0000 (17:51 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Dec 2023 01:51:24 +0000 (17:51 -0800)
commitc2d919cdfe56de1b3ba0ec019e6367957dd39f14
treef47ae57975d23e5046919c71d2b069fd0ea44b97
parent8f674972d698c1223b6b4f374df5dde835b88c34
parent7b5fe80ebc6312896a72f0187b00f7840579d4fd
Merge branch 'tools-ynl-gen-fill-in-the-gaps-in-support-of-legacy-families'

Jakub Kicinski says:

====================
tools: ynl-gen: fill in the gaps in support of legacy families

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).
====================

Link: https://lore.kernel.org/r/20231213231432.2944749-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>