Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'tools-ynl-gen-regeneration-comment-function-prefix'

Asbjørn Sloth Tønnesen says:

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

Link: https://patch.msgid.link/20251120174429.390574-1-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+57 -9
+1
drivers/android/binder_netlink.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/binder.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
drivers/android/binder_netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/binder.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_BINDER_GEN_H 7 8 #define _LINUX_BINDER_GEN_H
+1
drivers/dpll/dpll_nl.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/dpll.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
drivers/dpll/dpll_nl.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/dpll.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_DPLL_GEN_H 7 8 #define _LINUX_DPLL_GEN_H
+1
drivers/net/team/team_nl.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/team.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
drivers/net/team/team_nl.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/team.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_TEAM_GEN_H 7 8 #define _LINUX_TEAM_GEN_H
+1
fs/lockd/netlink.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/lockd.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
fs/lockd/netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/lockd.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_LOCKD_GEN_H 7 8 #define _LINUX_LOCKD_GEN_H
+1
fs/nfsd/netlink.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/nfsd.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
fs/nfsd/netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/nfsd.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_NFSD_GEN_H 7 8 #define _LINUX_NFSD_GEN_H
+1
include/uapi/linux/android/binder_netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/binder.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_ANDROID_BINDER_NETLINK_H 7 8 #define _UAPI_LINUX_ANDROID_BINDER_NETLINK_H
+1
include/uapi/linux/dpll.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/dpll.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_DPLL_H 7 8 #define _UAPI_LINUX_DPLL_H
+1
include/uapi/linux/fou.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/fou.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_FOU_H 7 8 #define _UAPI_LINUX_FOU_H
+1
include/uapi/linux/handshake.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/handshake.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_HANDSHAKE_H 7 8 #define _UAPI_LINUX_HANDSHAKE_H
+1
include/uapi/linux/if_team.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/team.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_IF_TEAM_H 7 8 #define _UAPI_LINUX_IF_TEAM_H
+1
include/uapi/linux/lockd_netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/lockd.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_LOCKD_NETLINK_H 7 8 #define _UAPI_LINUX_LOCKD_NETLINK_H
+1
include/uapi/linux/mptcp_pm.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/mptcp_pm.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_MPTCP_PM_H 7 8 #define _UAPI_LINUX_MPTCP_PM_H
+1
include/uapi/linux/net_shaper.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/net_shaper.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_NET_SHAPER_H 7 8 #define _UAPI_LINUX_NET_SHAPER_H
+1
include/uapi/linux/netdev.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/netdev.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_NETDEV_H 7 8 #define _UAPI_LINUX_NETDEV_H
+1
include/uapi/linux/nfsd_netlink.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/nfsd.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_NFSD_NETLINK_H 7 8 #define _UAPI_LINUX_NFSD_NETLINK_H
+1
include/uapi/linux/ovpn.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/ovpn.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_OVPN_H 7 8 #define _UAPI_LINUX_OVPN_H
+1
include/uapi/linux/psp.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/psp.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_PSP_H 7 8 #define _UAPI_LINUX_PSP_H
+1
net/core/netdev-genl-gen.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/netdev.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/core/netdev-genl-gen.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/netdev.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_NETDEV_GEN_H 7 8 #define _LINUX_NETDEV_GEN_H
+1
net/handshake/genl.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/handshake.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/handshake/genl.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/handshake.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_HANDSHAKE_GEN_H 7 8 #define _LINUX_HANDSHAKE_GEN_H
+1
net/ipv4/fou_nl.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/fou.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/ipv4/fou_nl.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/fou.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_FOU_GEN_H 7 8 #define _LINUX_FOU_GEN_H
+1
net/mptcp/mptcp_pm_gen.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/mptcp_pm.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/mptcp/mptcp_pm_gen.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/mptcp_pm.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_MPTCP_PM_GEN_H 7 8 #define _LINUX_MPTCP_PM_GEN_H
+1
net/psp/psp-nl-gen.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/psp.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/psp/psp-nl-gen.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/psp.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_PSP_GEN_H 7 8 #define _LINUX_PSP_GEN_H
+1
net/shaper/shaper_nl_gen.c
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/net_shaper.yaml */ 4 4 /* YNL-GEN kernel source */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #include <net/netlink.h> 7 8 #include <net/genetlink.h>
+1
net/shaper/shaper_nl_gen.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/net_shaper.yaml */ 4 4 /* YNL-GEN kernel header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _LINUX_NET_SHAPER_GEN_H 7 8 #define _LINUX_NET_SHAPER_GEN_H
+1
tools/include/uapi/linux/netdev.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/netdev.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_NETDEV_H 7 8 #define _UAPI_LINUX_NETDEV_H
+17 -9
tools/net/ynl/pyynl/ynl_gen_c.py
··· 1205 1205 1206 1206 1207 1207 class Family(SpecFamily): 1208 - def __init__(self, file_name, exclude_ops): 1208 + def __init__(self, file_name, exclude_ops, fn_prefix): 1209 1209 # Added by resolve: 1210 1210 self.c_name = None 1211 1211 delattr(self, "c_name") ··· 1236 1236 self.uapi_header_name = self.uapi_header[6:-2] 1237 1237 else: 1238 1238 self.uapi_header_name = self.ident_name 1239 + 1240 + self.fn_prefix = fn_prefix if fn_prefix else f'{self.ident_name}-nl' 1239 1241 1240 1242 def resolve(self): 1241 1243 self.resolve_up(super()) ··· 2913 2911 continue 2914 2912 2915 2913 if 'do' in op: 2916 - name = c_lower(f"{family.ident_name}-nl-{op_name}-doit") 2914 + name = c_lower(f"{family.fn_prefix}-{op_name}-doit") 2917 2915 cw.write_func_prot('int', name, 2918 2916 ['struct sk_buff *skb', 'struct genl_info *info'], suffix=';') 2919 2917 2920 2918 if 'dump' in op: 2921 - name = c_lower(f"{family.ident_name}-nl-{op_name}-dumpit") 2919 + name = c_lower(f"{family.fn_prefix}-{op_name}-dumpit") 2922 2920 cw.write_func_prot('int', name, 2923 2921 ['struct sk_buff *skb', 'struct netlink_callback *cb'], suffix=';') 2924 2922 cw.nl() ··· 2944 2942 for x in op['dont-validate']])), ) 2945 2943 for op_mode in ['do', 'dump']: 2946 2944 if op_mode in op: 2947 - name = c_lower(f"{family.ident_name}-nl-{op_name}-{op_mode}it") 2945 + name = c_lower(f"{family.fn_prefix}-{op_name}-{op_mode}it") 2948 2946 members.append((op_mode + 'it', name)) 2949 2947 if family.kernel_policy == 'per-op': 2950 2948 struct = Struct(family, op['attribute-set'], ··· 2982 2980 members.append(('validate', 2983 2981 ' | '.join([c_upper('genl-dont-validate-' + x) 2984 2982 for x in dont_validate])), ) 2985 - name = c_lower(f"{family.ident_name}-nl-{op_name}-{op_mode}it") 2983 + name = c_lower(f"{family.fn_prefix}-{op_name}-{op_mode}it") 2986 2984 if 'pre' in op[op_mode]: 2987 2985 members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre']))) 2988 2986 members.append((op_mode + 'it', name)) ··· 3404 3402 help='Do not overwrite the output file if the new output is identical to the old') 3405 3403 parser.add_argument('--exclude-op', action='append', default=[]) 3406 3404 parser.add_argument('-o', dest='out_file', type=str, default=None) 3405 + parser.add_argument('--function-prefix', dest='fn_prefix', type=str) 3407 3406 args = parser.parse_args() 3408 3407 3409 3408 if args.header is None: ··· 3413 3410 exclude_ops = [re.compile(expr) for expr in args.exclude_op] 3414 3411 3415 3412 try: 3416 - parsed = Family(args.spec, exclude_ops) 3413 + parsed = Family(args.spec, exclude_ops, args.fn_prefix) 3417 3414 if parsed.license != '((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)': 3418 3415 print('Spec license:', parsed.license) 3419 3416 print('License must be: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)') ··· 3433 3430 cw.p("/* Do not edit directly, auto-generated from: */") 3434 3431 cw.p(f"/*\t{spec_kernel} */") 3435 3432 cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */") 3436 - if args.exclude_op or args.user_header: 3433 + if args.exclude_op or args.user_header or args.fn_prefix: 3437 3434 line = '' 3438 - line += ' --user-header '.join([''] + args.user_header) 3439 - line += ' --exclude-op '.join([''] + args.exclude_op) 3435 + if args.user_header: 3436 + line += ' --user-header '.join([''] + args.user_header) 3437 + if args.exclude_op: 3438 + line += ' --exclude-op '.join([''] + args.exclude_op) 3439 + if args.fn_prefix: 3440 + line += f' --function-prefix {args.fn_prefix}' 3440 3441 cw.p(f'/* YNL-ARG{line} */') 3442 + cw.p('/* To regenerate run: tools/net/ynl/ynl-regen.sh */') 3441 3443 cw.nl() 3442 3444 3443 3445 if args.mode == 'uapi':