[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4d147da-3299-4ae7-b11e-b4309625e2c9@fiberby.net>
Date: Wed, 19 Nov 2025 19:19:28 +0000
From: Asbjørn Sloth Tønnesen <ast@...erby.net>
To: "Jason A. Donenfeld" <Jason@...c4.com>, Jakub Kicinski <kuba@...nel.org>,
Donald Hunter <donald.hunter@...il.com>
Cc: "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 04/11] netlink: specs: add specification for
wireguard
On 11/19/25 12:50 AM, Jakub Kicinski wrote:
> On Tue, 18 Nov 2025 23:52:30 +0100 Jason A. Donenfeld wrote:
>> On Tue, Nov 18, 2025 at 09:59:45PM +0000, Asbjørn Sloth Tønnesen wrote:
>>> So "c-function-prefix" or something might work better.
>>
>> Also fine with me. I'd just like consistent function naming, one way or
>> another.
>
> IIUC we're talking about the prefix for the kernel C codegen?
> Feels a bit like a one-off feature to me, but if we care deeply about
> it let's add it as a CLI param to the codegen. I don't think it's
> necessary to include this in the YAML spec.
IIUC then adding it as a CLI param is more work, and just moves family details
to ynl-regen, might as well skip the CLI param then and hack it in the codegen.
Before posting any new patches, I would like to get consensus on this.
Options:
A) As-is and all 4 functions gets renamed.
Stacktraces, gdb scripts, tracing etc. changes due to the 4 function renames.
B) Add a "operations"->"function-prefix" in YAML, only one funtion gets renamed.
wg_get_device_start(), wg_get_device_dump() and wg_get_device_done() keep
their names, while wg_set_device() gets renamed to wg_set_device_doit().
This compliments the existing "name-prefix" (which is used for the UAPI enum names).
Documentation/netlink/genetlink-legacy.yaml | 6 ++++++
tools/net/ynl/pyynl/ynl_gen_c.py | 13 +++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
C) Add a "call" in YAML to override the default doit/dumpit names.
All 4 functions can keep their current names.
This compliments the existing "pre" and "post" (which are only rendered when set).
How these map to struct genl_split_ops:
kind \ YAML | pre | call | post
-------------+------------+---------+------------
do | .pre_doit | .doit | .post_doit
dump | .start | .dumpit | .done
D) Add it as a ynl_gen_c.py CLI param and make ynl-regen set it for wireguard?
While A is a no-op, then B is simpler to implement than option C, as the names are
generated in multiple places, where as it's simple to just use a prefix.
So option C might require some more refactoring, than is worth it for an one-off feature.
OTOH option C is more flexible than option B.
Jason, would option B work for you?
Jakub, would option B or C be acceptable?
WDYT?
Powered by blists - more mailing lists