Skip to contentSkip to conversation

tools: ynl-gen: regeneration comment + function prefix

PATCH Applied Asbjørn Sloth Tønnesen 5 participants 8 messages Nov 20, 2025 – Nov 26, 2025

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

cover tools: ynl-gen: regeneration comment + function prefix

It looks like these two patches are the last ones needed for YNL, before the WireGuard patches can go in.

These patches was both requested by Jason, during review of the WireGuard YNL conversion patchset[1].

[1] https://lore.kernel.org/r/[email protected]/T/#u

Asbjørn Sloth Tønnesen (2):
tools: ynl-gen: add function prefix argument
tools: ynl-gen: add regeneration comment

 drivers/android/binder_netlink.c              |  1 +
 drivers/android/binder_netlink.h              |  1 +
 drivers/dpll/dpll_nl.c                        |  1 +
 drivers/dpll/dpll_nl.h                        |  1 +
 drivers/net/ovpn/netlink-gen.c                |  1 +
 drivers/net/ovpn/netlink-gen.h                |  1 +
 drivers/net/team/team_nl.c                    |  1 +
 drivers/net/team/team_nl.h                    |  1 +
 fs/lockd/netlink.c                            |  1 +
 fs/lockd/netlink.h                            |  1 +
 fs/nfsd/netlink.c                             |  1 +
 fs/nfsd/netlink.h                             |  1 +
 include/uapi/linux/android/binder_netlink.h   |  1 +
 include/uapi/linux/dpll.h                     |  1 +
 .../uapi/linux/ethtool_netlink_generated.h    |  1 +
 include/uapi/linux/fou.h                      |  1 +
 include/uapi/linux/handshake.h                |  1 +
 include/uapi/linux/if_team.h                  |  1 +
 include/uapi/linux/lockd_netlink.h            |  1 +
 include/uapi/linux/mptcp_pm.h                 |  1 +
 include/uapi/linux/net_shaper.h               |  1 +
 include/uapi/linux/netdev.h                   |  1 +
 include/uapi/linux/nfsd_netlink.h             |  1 +
 include/uapi/linux/ovpn.h                     |  1 +
 include/uapi/linux/psp.h                      |  1 +
 net/core/netdev-genl-gen.c                    |  1 +
 net/core/netdev-genl-gen.h                    |  1 +
 net/devlink/netlink_gen.c                     |  1 +
 net/devlink/netlink_gen.h                     |  1 +
 net/handshake/genl.c                          |  1 +
 net/handshake/genl.h                          |  1 +
 net/ipv4/fou_nl.c                             |  1 +
 net/ipv4/fou_nl.h                             |  1 +
 net/mptcp/mptcp_pm_gen.c                      |  1 +
 net/mptcp/mptcp_pm_gen.h                      |  1 +
 net/psp/psp-nl-gen.c                          |  1 +
 net/psp/psp-nl-gen.h                          |  1 +
 net/shaper/shaper_nl_gen.c                    |  1 +
 net/shaper/shaper_nl_gen.h                    |  1 +
 tools/include/uapi/linux/netdev.h             |  1 +
 tools/net/ynl/pyynl/ynl_gen_c.py              | 26 ++++++++++++-------
 41 files changed, 57 insertions(+), 9 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/2 tools: ynl-gen: add function prefix argument

This patch adds a new CLI argument for overriding the default function prefix, as used for naming the doit/dumpit functions in the generated kernel code.

When not specified the default "$(FAMILY)-nl" is used.

This can also be specified persistently in generated files:
/* YNL-ARG --function-prefix wg */

In the above example it causes the following changes:
wireguard_nl_get_device_dumpit() -> wg_get_device_dumpit()
wireguard_nl_get_device_doit() -> wg_get_device_doit()

The variable name fn_prefix, was chosen as it relates to op_prefix which is used to prefix the UAPI commands enum entries.

---
 tools/net/ynl/pyynl/ynl_gen_c.py | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
tools/net/ynl/pyynl/ynl_gen_c.py +16 -9
index aadeb3abcad8..0dd589e502cb 100755
@@ -1205,7 +1205,7 @@ class SubMessage(SpecSubMessage):
 
 
 class Family(SpecFamily):
-    def __init__(self, file_name, exclude_ops):
+    def __init__(self, file_name, exclude_ops, fn_prefix):
         # Added by resolve:
         self.c_name = None
         delattr(self, "c_name")
@@ -1237,6 +1237,8 @@ class Family(SpecFamily):
         else:
             self.uapi_header_name = self.ident_name
 
+        self.fn_prefix = fn_prefix if fn_prefix else f'{self.ident_name}-nl'
+
     def resolve(self):
         self.resolve_up(super())
 
@@ -2911,12 +2913,12 @@ def print_kernel_op_table_fwd(family, cw, terminate):
             continue
 
         if 'do' in op:
-            name = c_lower(f"{family.ident_name}-nl-{op_name}-doit")
+            name = c_lower(f"{family.fn_prefix}-{op_name}-doit")
             cw.write_func_prot('int', name,
                                ['struct sk_buff *skb', 'struct genl_info *info'], suffix=';')
 
         if 'dump' in op:
-            name = c_lower(f"{family.ident_name}-nl-{op_name}-dumpit")
+            name = c_lower(f"{family.fn_prefix}-{op_name}-dumpit")
             cw.write_func_prot('int', name,
                                ['struct sk_buff *skb', 'struct netlink_callback *cb'], suffix=';')
     cw.nl()
@@ -2942,7 +2944,7 @@ def print_kernel_op_table(family, cw):
                                             for x in op['dont-validate']])), )
             for op_mode in ['do', 'dump']:
                 if op_mode in op:
-                    name = c_lower(f"{family.ident_name}-nl-{op_name}-{op_mode}it")
+                    name = c_lower(f"{family.fn_prefix}-{op_name}-{op_mode}it")
                     members.append((op_mode + 'it', name))
             if family.kernel_policy == 'per-op':
                 struct = Struct(family, op['attribute-set'],
@@ -2980,7 +2982,7 @@ def print_kernel_op_table(family, cw):
                         members.append(('validate',
                                         ' | '.join([c_upper('genl-dont-validate-' + x)
                                                     for x in dont_validate])), )
-                name = c_lower(f"{family.ident_name}-nl-{op_name}-{op_mode}it")
+                name = c_lower(f"{family.fn_prefix}-{op_name}-{op_mode}it")
                 if 'pre' in op[op_mode]:
                     members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre'])))
                 members.append((op_mode + 'it', name))
@@ -3402,6 +3404,7 @@ def main():
                         help='Do not overwrite the output file if the new output is identical to the old')
     parser.add_argument('--exclude-op', action='append', default=[])
     parser.add_argument('-o', dest='out_file', type=str, default=None)
+    parser.add_argument('--function-prefix', dest='fn_prefix', type=str)
     args = parser.parse_args()
 
     if args.header is None:
@@ -3410,7 +3413,7 @@ def main():
     exclude_ops = [re.compile(expr) for expr in args.exclude_op]
 
     try:
-        parsed = Family(args.spec, exclude_ops)
+        parsed = Family(args.spec, exclude_ops, args.fn_prefix)
         if parsed.license != '((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)':
             print('Spec license:', parsed.license)
             print('License must be: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)')
@@ -3430,10 +3433,14 @@ def main():
     cw.p("/* Do not edit directly, auto-generated from: */")
     cw.p(f"/*\t{spec_kernel} */")
     cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */")
-    if args.exclude_op or args.user_header:
+    if args.exclude_op or args.user_header or args.fn_prefix:
         line = ''
-        line += ' --user-header '.join([''] + args.user_header)
-        line += ' --exclude-op '.join([''] + args.exclude_op)
+        if args.user_header:
+            line += ' --user-header '.join([''] + args.user_header)
+        if args.exclude_op:
+            line += ' --exclude-op '.join([''] + args.exclude_op)
+        if args.fn_prefix:
+            line += f' --function-prefix {args.fn_prefix}'
         cw.p(f'/* YNL-ARG{line} */')
     cw.nl()
 
Signature · 1 line
2.51.0
#2 lore raw

PATCH 2/2 tools: ynl-gen: add regeneration comment

In reply to Asbjørn Sloth Tønnesen

Add a comment on regeneration to the generated files.

The comment is placed after the YNL-GEN line[1], as to not interfere with ynl-regen.sh's detection logic.

[1] and after the optional YNL-ARG line.

---
 drivers/android/binder_netlink.c               | 1 +
 drivers/android/binder_netlink.h               | 1 +
 drivers/dpll/dpll_nl.c                         | 1 +
 drivers/dpll/dpll_nl.h                         | 1 +
 drivers/net/ovpn/netlink-gen.c                 | 1 +
 drivers/net/ovpn/netlink-gen.h                 | 1 +
 drivers/net/team/team_nl.c                     | 1 +
 drivers/net/team/team_nl.h                     | 1 +
 fs/lockd/netlink.c                             | 1 +
 fs/lockd/netlink.h                             | 1 +
 fs/nfsd/netlink.c                              | 1 +
 fs/nfsd/netlink.h                              | 1 +
 include/uapi/linux/android/binder_netlink.h    | 1 +
 include/uapi/linux/dpll.h                      | 1 +
 include/uapi/linux/ethtool_netlink_generated.h | 1 +
 include/uapi/linux/fou.h                       | 1 +
 include/uapi/linux/handshake.h                 | 1 +
 include/uapi/linux/if_team.h                   | 1 +
 include/uapi/linux/lockd_netlink.h             | 1 +
 include/uapi/linux/mptcp_pm.h                  | 1 +
 include/uapi/linux/net_shaper.h                | 1 +
 include/uapi/linux/netdev.h                    | 1 +
 include/uapi/linux/nfsd_netlink.h              | 1 +
 include/uapi/linux/ovpn.h                      | 1 +
 include/uapi/linux/psp.h                       | 1 +
 net/core/netdev-genl-gen.c                     | 1 +
 net/core/netdev-genl-gen.h                     | 1 +
 net/devlink/netlink_gen.c                      | 1 +
 net/devlink/netlink_gen.h                      | 1 +
 net/handshake/genl.c                           | 1 +
 net/handshake/genl.h                           | 1 +
 net/ipv4/fou_nl.c                              | 1 +
 net/ipv4/fou_nl.h                              | 1 +
 net/mptcp/mptcp_pm_gen.c                       | 1 +
 net/mptcp/mptcp_pm_gen.h                       | 1 +
 net/psp/psp-nl-gen.c                           | 1 +
 net/psp/psp-nl-gen.h                           | 1 +
 net/shaper/shaper_nl_gen.c                     | 1 +
 net/shaper/shaper_nl_gen.h                     | 1 +
 tools/include/uapi/linux/netdev.h              | 1 +
 tools/net/ynl/pyynl/ynl_gen_c.py               | 1 +
 41 files changed, 41 insertions(+)
drivers/android/binder_netlink.c +1 -0
index d05397a50ca6..81e8432b5904 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/binder.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
drivers/android/binder_netlink.h +1 -0
index 882c7a6b537e..57399942a5e3 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/binder.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_BINDER_GEN_H
 #define _LINUX_BINDER_GEN_H
drivers/dpll/dpll_nl.c +1 -0
index 3c6d570babf8..36d11ff195df 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/dpll.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
drivers/dpll/dpll_nl.h +1 -0
index 3da10cfe9a6e..7419679b6977 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/dpll.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_DPLL_GEN_H
 #define _LINUX_DPLL_GEN_H
drivers/net/ovpn/netlink-gen.c +1 -0
index 14298188c5f1..ecbe9dcf4f7d 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/ovpn.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
drivers/net/ovpn/netlink-gen.h +1 -0
index 220b5b2fdd4f..b2301580770f 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/ovpn.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_OVPN_GEN_H
 #define _LINUX_OVPN_GEN_H
drivers/net/team/team_nl.c +1 -0
index 208424ab78f5..6db21725f9cc 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/team.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
drivers/net/team/team_nl.h +1 -0
index c9ec1b22ac4d..74816b193475 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/team.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_TEAM_GEN_H
 #define _LINUX_TEAM_GEN_H
fs/lockd/netlink.c +1 -0
index 6e00b02cad90..880c42b4f8c3 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/lockd.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
fs/lockd/netlink.h +1 -0
index 1920543a7955..d8408f077dd8 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/lockd.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_LOCKD_GEN_H
 #define _LINUX_LOCKD_GEN_H
fs/nfsd/netlink.c +1 -0
index ca54aa583530..ac51a44e1065 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/nfsd.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
fs/nfsd/netlink.h +1 -0
index 8eb903f24c41..478117ff6b8c 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/nfsd.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_NFSD_GEN_H
 #define _LINUX_NFSD_GEN_H
include/uapi/linux/android/binder_netlink.h +1 -0
index b218f96d6668..bf69833c9a19 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/binder.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_ANDROID_BINDER_NETLINK_H
 #define _UAPI_LINUX_ANDROID_BINDER_NETLINK_H
include/uapi/linux/dpll.h +1 -0
index 69d35570ac4f..b7ff9c44f9aa 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/dpll.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_DPLL_H
 #define _UAPI_LINUX_DPLL_H
include/uapi/linux/ethtool_netlink_generated.h +1 -0
index b71b175df46d..556a0c834df5 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/ethtool.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_ETHTOOL_NETLINK_GENERATED_H
 #define _UAPI_LINUX_ETHTOOL_NETLINK_GENERATED_H
include/uapi/linux/fou.h +1 -0
index b5cd3e7b3775..bb6bef74d2d1 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/fou.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_FOU_H
 #define _UAPI_LINUX_FOU_H
include/uapi/linux/handshake.h +1 -0
index 662e7de46c54..d7e40f594888 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/handshake.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_HANDSHAKE_H
 #define _UAPI_LINUX_HANDSHAKE_H
include/uapi/linux/if_team.h +1 -0
index a5c06243a435..f4cd839ae725 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/team.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_IF_TEAM_H
 #define _UAPI_LINUX_IF_TEAM_H
include/uapi/linux/lockd_netlink.h +1 -0
index 21c65aec3bc6..2d766a0fa6ea 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/lockd.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_LOCKD_NETLINK_H
 #define _UAPI_LINUX_LOCKD_NETLINK_H
include/uapi/linux/mptcp_pm.h +1 -0
index bf44a5cf5b5a..c97d060ee90b 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/mptcp_pm.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_MPTCP_PM_H
 #define _UAPI_LINUX_MPTCP_PM_H
include/uapi/linux/net_shaper.h +1 -0
index d8834b59f7d7..3dd22c2930d9 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/net_shaper.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_NET_SHAPER_H
 #define _UAPI_LINUX_NET_SHAPER_H
include/uapi/linux/netdev.h +1 -0
index 048c8de1a130..e0b579a1df4f 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/netdev.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_NETDEV_H
 #define _UAPI_LINUX_NETDEV_H
include/uapi/linux/nfsd_netlink.h +1 -0
index 887cbd12b695..e157e2009ea8 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/nfsd.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_NFSD_NETLINK_H
 #define _UAPI_LINUX_NFSD_NETLINK_H
include/uapi/linux/ovpn.h +1 -0
index 680d1522dc87..959b41def61f 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/ovpn.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_OVPN_H
 #define _UAPI_LINUX_OVPN_H
include/uapi/linux/psp.h +1 -0
index d8449c043ba1..a3a336488dc3 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/psp.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_PSP_H
 #define _UAPI_LINUX_PSP_H
net/core/netdev-genl-gen.c +1 -0
index ff20435c45d2..ba673e81716f 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/netdev.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/core/netdev-genl-gen.h +1 -0
index cf3fad74511f..cffc08517a41 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/netdev.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_NETDEV_GEN_H
 #define _LINUX_NETDEV_GEN_H
net/devlink/netlink_gen.c +1 -0
index 5ad435aee29d..f998a7378381 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/devlink.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/devlink/netlink_gen.h +1 -0
index 09cc6f264ccf..2817d53a0eba 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/devlink.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_DEVLINK_GEN_H
 #define _LINUX_DEVLINK_GEN_H
net/handshake/genl.c +1 -0
index f55d14d7b726..870612609491 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/handshake.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/handshake/genl.h +1 -0
index ae72a596f6cc..8d3e18672daf 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/handshake.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_HANDSHAKE_GEN_H
 #define _LINUX_HANDSHAKE_GEN_H
net/ipv4/fou_nl.c +1 -0
index 506260b4a4dc..7a99639204b1 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/fou.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/ipv4/fou_nl.h +1 -0
index 63a6c4ed803d..438342dc8507 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/fou.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_FOU_GEN_H
 #define _LINUX_FOU_GEN_H
net/mptcp/mptcp_pm_gen.c +1 -0
index dcffd847af33..c180930a8e0e 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/mptcp_pm.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/mptcp/mptcp_pm_gen.h +1 -0
index e24258f6f819..b9280bcb43f5 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/mptcp_pm.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_MPTCP_PM_GEN_H
 #define _LINUX_MPTCP_PM_GEN_H
net/psp/psp-nl-gen.c +1 -0
index 73f8b06d66f0..22a48d0fa378 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/psp.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/psp/psp-nl-gen.h +1 -0
index 5bc3b5d5a53e..599c5f1c82f2 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/psp.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_PSP_GEN_H
 #define _LINUX_PSP_GEN_H
net/shaper/shaper_nl_gen.c +1 -0
index 204c8ae8c7b1..e8cccc4c1180 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/net_shaper.yaml */
 /* YNL-GEN kernel source */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
net/shaper/shaper_nl_gen.h +1 -0
index cb7f9026fc23..ec41c90431a4 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/net_shaper.yaml */
 /* YNL-GEN kernel header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _LINUX_NET_SHAPER_GEN_H
 #define _LINUX_NET_SHAPER_GEN_H
tools/include/uapi/linux/netdev.h +1 -0
index 048c8de1a130..e0b579a1df4f 100644
@@ -2,6 +2,7 @@
 /* Do not edit directly, auto-generated from: */
 /*	Documentation/netlink/specs/netdev.yaml */
 /* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
 
 #ifndef _UAPI_LINUX_NETDEV_H
 #define _UAPI_LINUX_NETDEV_H
tools/net/ynl/pyynl/ynl_gen_c.py +1 -0
index 0dd589e502cb..b517d0c605ad 100755
@@ -3442,6 +3442,7 @@ def main():
         if args.fn_prefix:
             line += f' --function-prefix {args.fn_prefix}'
         cw.p(f'/* YNL-ARG{line} */')
+    cw.p('/* To regenerate run: tools/net/ynl/ynl-regen.sh */')
     cw.nl()
 
     if args.mode == 'uapi':
Signature · 1 line
2.51.0
maintainer Acked-by on v1 2/2
#3 lore raw

Re: [PATCH net-next 2/2] tools: ynl-gen: add regeneration comment

Hi Asbjørn,

Quoted 4 lines · Asbjørn Sloth Tønnesen

Add a comment on regeneration to the generated files.

The comment is placed after the YNL-GEN line[1], as to not interfere with ynl-regen.sh's detection logic.

Good idea, I always need to search for command :)

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
maintainer
#4 lore raw

Re: [PATCH net-next 2/2] tools: ynl-gen: add regeneration comment

In reply to Asbjørn Sloth Tønnesen
Quoted 6 lines · On Thu, 20 Nov 2025 17:44:27 +0000 Asbjørn Sloth Tønnesen wrote:

Add a comment on regeneration to the generated files.

The comment is placed after the YNL-GEN line[1], as to not interfere with ynl-regen.sh's detection logic.

[1] and after the optional YNL-ARG line.

Let's make this comment also optional? Detect whether it's there in the bash script and pass appropriate flag to C gen?

Signature · 1 line
pw-bot: cr
maintainer
#5 lore raw

Re: [PATCH net-next 2/2] tools: ynl-gen: add regeneration comment

Quoted 10 lines · On Thu, 20 Nov 2025 10:02:40 -0800 Jakub Kicinski wrote:
Quoted 6 lines · On Thu, 20 Nov 2025 17:44:27 +0000 Asbjørn Sloth Tønnesen wrote:

Add a comment on regeneration to the generated files.

The comment is placed after the YNL-GEN line[1], as to not interfere with ynl-regen.sh's detection logic.

[1] and after the optional YNL-ARG line.

Let's make this comment also optional? Detect whether it's there in the bash script and pass appropriate flag to C gen?

Raced responding with Matthieu. Sounds like a strong signal that this is useful, so let's keep the patch as is. I'll revive it in pw.

#6 lore raw
In reply to Asbjørn Sloth Tønnesen

Hi Asbjørn,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/19546818189

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/f040cba4ef2e
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1025958

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

#7 lore raw
In reply to Asbjørn Sloth Tønnesen
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 20 Nov 2025 17:44:25 +0000 you wrote:

It looks like these two patches are the last ones needed for YNL, before the WireGuard patches can go in.

These patches was both requested by Jason, during review of the WireGuard YNL conversion patchset[1].

[1] https://lore.kernel.org/r/[email protected]/T/#u

[...]

Here is the summary with links:
- [net-next,1/2] tools: ynl-gen: add function prefix argument

    https://git.kernel.org/netdev/net-next/c/17fa6ee35bd4
  - [net-next,2/2] tools: ynl-gen: add regeneration comment
    https://git.kernel.org/netdev/net-next/c/68e83f347266

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html