[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251119191958.07d9de89@kernel.org>
Date: Wed, 19 Nov 2025 19:19:58 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: Asbjørn Sloth Tønnesen
<ast@...erby.net>, Donald Hunter <donald.hunter@...il.com>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Jacob Keller
<jacob.e.keller@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>,
wireguard@...ts.zx2c4.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Jordan Rife <jordan@...fe.io>
Subject: Re: [PATCH net-next v3 11/11] wireguard: netlink: generate netlink
code
On Thu, 20 Nov 2025 03:46:39 +0100 Jason A. Donenfeld wrote:
> > Do you care about the exact cmdline of the python tool, or can we just
> > append:
> >
> > /* To regenerate run: tools/net/ynl/ynl-regen.sh */
>
> The args are non-trivial, right?
They aren't all that complicated TBH, quoting slightly modified from
tools/net/ynl/ynl-regen.sh:
$TOOL --mode $mode --$type --spec $KDIR/$yaml_spec $extra_args -o $output
The line just gets quote long for my taste with all the paths in place.
Somewhere along the line we added --cmp-out to make sure output isn't
modified on every regen attempt (for the benefit of incremental builds).
> The idea is so that these files can be regenerated in a few years
> when the ynl project has widely succeeded and we've all paged this
> out of our minds and forgotten how it all worked.
We run ./tools/net/ynl/ynl-regen.sh in our CI, checking if anything
diverged. Primarily because in early days, when codegen was modified
more often, I was worried we'll break the generation for some of the
specs.
The documentation also basically says "create the fake header where
you want the file to be and run ./tools/net/ynl/ynl-regen.sh".
https://docs.kernel.org/userspace-api/netlink/intro-specs.html#generating-kernel-code
Admittedly most of this comes down to "what Jakub found convenient
when developing the specs" :S
Powered by blists - more mailing lists