[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231213231432.2944749-1-kuba@kernel.org>
Date: Wed, 13 Dec 2023 15:14:24 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
nicolas.dichtel@...nd.com,
jiri@...nulli.us,
donald.hunter@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH net-next 0/8] 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).
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
Powered by blists - more mailing lists