netlink: specs: enforce strict naming of properties
Subsystems (7)
Jakub Kicinski
maintainercover netlink: specs: enforce strict naming of properties
I got annoyed once again by the name properties in the ethtool spec which use underscore instead of dash. I previously assumed that there is a lot of such properties in the specs so fixing them now would be near impossible. On a closer look, however, I only found 22 (rough grep suggests we have ~4.8k names in the specs, so bad ones are just 0.46%).
Add a regex to the JSON schema to enforce the naming, fix the few bad names. I was hoping we could start enforcing this from newer families, but there's no correlation between the protocol and the number of errors. If anything classic netlink has more recently added specs so it has fewer errors.
The regex is just for name properties which will end up visible to the user (in Python or YNL CLI). I left the c-name properties alone, those don't matter as much. C codegen rewrites them, anyway.
I'm not updating the spec for genetlink-c. Looks like it has no users, new families use genetlink, all old ones need genetlink-legacy. If these patches are merged I will remove genetlink-c completely in net-next.
Jakub Kicinski (10):
netlink: specs: nfsd: replace underscores with dashes in names
netlink: specs: fou: replace underscores with dashes in names
netlink: specs: ethtool: replace underscores with dashes in names
netlink: specs: dpll: replace underscores with dashes in names
netlink: specs: devlink: replace underscores with dashes in names
netlink: specs: ovs_flow: replace underscores with dashes in names
netlink: specs: mptcp: replace underscores with dashes in names
netlink: specs: rt-link: replace underscores with dashes in names
netlink: specs: tc: replace underscores with dashes in names
netlink: specs: enforce strict naming of properties
Documentation/netlink/genetlink-legacy.yaml | 15 ++++---- Documentation/netlink/genetlink.yaml | 17 +++++---- Documentation/netlink/netlink-raw.yaml | 18 ++++++---- Documentation/netlink/specs/devlink.yaml | 8 ++--- Documentation/netlink/specs/dpll.yaml | 2 +- Documentation/netlink/specs/ethtool.yaml | 6 ++-- Documentation/netlink/specs/fou.yaml | 36 +++++++++---------- Documentation/netlink/specs/mptcp_pm.yaml | 8 ++--- Documentation/netlink/specs/nfsd.yaml | 4 +-- Documentation/netlink/specs/ovs_flow.yaml | 6 ++-- Documentation/netlink/specs/rt-link.yaml | 4 +-- Documentation/netlink/specs/tc.yaml | 4 +-- include/uapi/linux/mptcp_pm.h | 6 ++-- .../drivers/net/hw/rss_input_xfrm.py | 2 +- 14 files changed, 74 insertions(+), 62 deletions(-)
Signature · 1 line
2.49.0
Jakub Kicinski
maintainerPATCH 1/10 netlink: specs: nfsd: replace underscores with dashes in names
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/nfsd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/netlink/specs/nfsd.yaml +2 -2
@@ -27,7 +27,7 @@ doc: NFSD configuration over generic netlink. name: proc type: u32 - - name: service_time + name: service-time type: s64 - name: pad
@@ -139,7 +139,7 @@ doc: NFSD configuration over generic netlink. - prog - version - proc - - service_time + - service-time - saddr4 - daddr4 - saddr6
Signature · 1 line
2.49.0
Re: [PATCH net 01/10] netlink: specs: nfsd: replace underscores with dashes in names
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 13727f85b49b ("NFSD: introduce netlink stubs")Signed-off-by Jakub Kicinski <[email protected]>
Re: [PATCH net 01/10] netlink: specs: nfsd: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 30 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 13727f85b49b ("NFSD: introduce netlink stubs")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/nfsd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/netlink/specs/nfsd.yaml +1
-1@@ -27,7 +27,7 @@ doc: NFSD configuration over generic netlink. name: proc type: u32 - - name: service_time + name: service-time type: s64 - name: pad
Documentation/netlink/specs/nfsd.yaml doc: NFSD configuration over generic netlink. · line 145
Quoted 8 lines
Documentation/netlink/specs/nfsd.yaml +1
-1@@ -139,7 +139,7 @@ doc: NFSD configuration over generic netlink. - prog - version - proc - - service_time + - service-time - saddr4 - daddr4 - saddr6
Re: [PATCH net 01/10] netlink: specs: nfsd: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 30 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 13727f85b49b ("NFSD: introduce netlink stubs")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/nfsd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/netlink/specs/nfsd.yaml +1
-1@@ -27,7 +27,7 @@ doc: NFSD configuration over generic netlink. name: proc type: u32 - - name: service_time + name: service-time type: s64 - name: pad
Documentation/netlink/specs/nfsd.yaml doc: NFSD configuration over generic netlink. · line 145
Quoted 8 lines
Documentation/netlink/specs/nfsd.yaml +1
-1@@ -139,7 +139,7 @@ doc: NFSD configuration over generic netlink. - prog - version - proc - - service_time + - service-time - saddr4 - daddr4 - saddr6
Signature · 1 line
Chuck Lever
Jakub Kicinski
maintainerPATCH 2/10 netlink: specs: fou: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/fou.yaml | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-)
Documentation/netlink/specs/fou.yaml +18 -18
@@ -15,7 +15,7 @@ kernel-policy: global definitions: - type: enum - name: encap_type + name: encap-type name-prefix: fou-encap- enum-name: entries: [ unspec, direct, gue ]
@@ -43,26 +43,26 @@ kernel-policy: global name: type type: u8 - - name: remcsum_nopartial + name: remcsum-nopartial type: flag - - name: local_v4 + name: local-v4 type: u32 - - name: local_v6 + name: local-v6 type: binary checks: min-len: 16 - - name: peer_v4 + name: peer-v4 type: u32 - - name: peer_v6 + name: peer-v6 type: binary checks: min-len: 16 - - name: peer_port + name: peer-port type: u16 byte-order: big-endian -
@@ -90,12 +90,12 @@ kernel-policy: global - port - ipproto - type - - remcsum_nopartial - - local_v4 - - peer_v4 - - local_v6 - - peer_v6 - - peer_port + - remcsum-nopartial + - local-v4 + - peer-v4 + - local-v6 + - peer-v6 + - peer-port - ifindex -
@@ -112,11 +112,11 @@ kernel-policy: global - af - ifindex - port - - peer_port - - local_v4 - - peer_v4 - - local_v6 - - peer_v6 + - peer-port + - local-v4 + - peer-v4 + - local-v6 + - peer-v6 - name: get
Signature · 1 line
2.49.0
Re: [PATCH net 02/10] netlink: specs: fou: replace underscores with dashes in names
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 4eb77b4ecd3c ("netlink: add a proto specification for FOU")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 3/10 netlink: specs: ethtool: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen replaces special chars in names) but gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/ethtool.yaml | 6 +++--- tools/testing/selftests/drivers/net/hw/rss_input_xfrm.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
Documentation/netlink/specs/ethtool.yaml +3 -3
@@ -48,7 +48,7 @@ c-version-name: ethtool-genl-version name: started doc: The firmware flashing process has started. - - name: in_progress + name: in-progress doc: The firmware flashing process is in progress. - name: completed
@@ -1422,7 +1422,7 @@ c-version-name: ethtool-genl-version name: hkey type: binary - - name: input_xfrm + name: input-xfrm type: u32 - name: start-context
@@ -2238,7 +2238,7 @@ c-version-name: ethtool-genl-version - hfunc - indir - hkey - - input_xfrm + - input-xfrm dump: request: attributes:
tools/testing/selftests/drivers/net/hw/rss_input_xfrm.py +1 -1
@@ -38,7 +38,7 @@ from lib.py import rand_port raise KsftSkipEx("socket.SO_INCOMING_CPU was added in Python 3.11") input_xfrm = cfg.ethnl.rss_get( - {'header': {'dev-name': cfg.ifname}}).get('input_xfrm') + {'header': {'dev-name': cfg.ifname}}).get('input-xfrm') # Check for symmetric xor/or-xor if not input_xfrm or (input_xfrm != 1 and input_xfrm != 2):
Signature · 1 line
2.49.0
Re: [PATCH net 03/10] netlink: specs: ethtool: replace underscores with dashes in names
Quoted 4 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen replaces special chars in names) but gives more uniform naming in Python.
Thank you!
Quoted 3 lines
Fixes 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")Fixes 46fb3ba95b93 ("ethtool: Add an interface for flashing transceivermodules' firmware")
Why do you use fixes tag? You are not fixing something broken but standardizing the python naming.
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Jakub Kicinski
maintainerRe: [PATCH net 03/10] netlink: specs: ethtool: replace underscores with dashes in names
Quoted 6 lines · On Wed, 25 Jun 2025 01:07:15 +0200 Kory Maincent wrote:
Quoted 3 lines
Fixes 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")Fixes 46fb3ba95b93 ("ethtool: Add an interface for flashing transceivermodules' firmware")
Why do you use fixes tag? You are not fixing something broken but standardizing the python naming.
To direct them within stable releases. I think it's worth pushing this change into 6.12 LTS in case someone packages YNL out of there. One could argue this is a breaking change for Python users.
Re: [PATCH net 03/10] netlink: specs: ethtool: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 8 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen replaces special chars in names) but gives more uniform naming in Python.
Fixes 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")Fixes 46fb3ba95b93 ("ethtool: Add an interface for flashing transceiver modules' firmware")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 4/10 netlink: specs: dpll: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/dpll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/netlink/specs/dpll.yaml +1 -1
@@ -188,7 +188,7 @@ doc: DPLL subsystem. value: 10000 - type: const - name: pin-frequency-77_5-khz + name: pin-frequency-77-5-khz value: 77500 - type: const
Signature · 1 line
2.49.0
Re: [PATCH net 04/10] netlink: specs: dpll: replace underscores with dashes in names
Quoted 23 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 3badff3a25d8 ("dpll: spec: Add Netlink spec in YAML")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/dpll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/netlink/specs/dpll.yaml +0
-0
Documentation/netlink/specs/dpll.yaml doc: DPLL subsystem. · line 194
Quoted 8 lines
Documentation/netlink/specs/dpll.yaml +1
-1@@ -188,7 +188,7 @@ doc: DPLL subsystem. value: 10000 - type: const - name: pin-frequency-77_5-khz + name: pin-frequency-77-5-khz value: 77500 - type: const
Re: [PATCH net 04/10] netlink: specs: dpll: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 3badff3a25d8 ("dpll: spec: Add Netlink spec in YAML")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 5/10 netlink: specs: devlink: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/devlink.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/netlink/specs/devlink.yaml +4 -4
@@ -38,15 +38,15 @@ doc: Partial family for Devlink. - name: dsa - - name: pci_pf + name: pci-pf - - name: pci_vf + name: pci-vf - name: virtual - name: unused - - name: pci_sf + name: pci-sf - type: enum name: port-fn-state
@@ -220,7 +220,7 @@ doc: Partial family for Devlink. - name: flag - - name: nul_string + name: nul-string value: 10 - name: binary
Signature · 1 line
2.49.0
Re: [PATCH net 05/10] netlink: specs: devlink: replace underscores with dashes in names
Quoted 42 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 429ac6211494 ("devlink: define enum for attr types of dynamic attributes")Fixes f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/devlink.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)Documentation/netlink/specs/devlink.yaml +3
-3@@ -38,15 +38,15 @@ doc: Partial family for Devlink. - name: dsa - - name: pci_pf + name: pci-pf - - name: pci_vf + name: pci-vf - name: virtual - name: unused - - name: pci_sf + name: pci-sf - type: enum name: port-fn-state
Documentation/netlink/specs/devlink.yaml doc: Partial family for Devlink. · line 226
Quoted 8 lines
Documentation/netlink/specs/devlink.yaml +1
-1@@ -220,7 +220,7 @@ doc: Partial family for Devlink. - name: flag - - name: nul_string + name: nul-string value: 10 - name: binary
Re: [PATCH net 05/10] netlink: specs: devlink: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 8 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 429ac6211494 ("devlink: define enum for attr types of dynamic attributes")Fixes f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 6/10 netlink: specs: ovs_flow: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/ovs_flow.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/netlink/specs/ovs_flow.yaml +3 -3
@@ -216,7 +216,7 @@ uapi-header: linux/openvswitch.h type: struct members: - - name: nd_target + name: nd-target type: binary len: 16 byte-order: big-endian
@@ -258,12 +258,12 @@ uapi-header: linux/openvswitch.h type: struct members: - - name: vlan_tpid + name: vlan-tpid type: u16 byte-order: big-endian doc: Tag protocol identifier (TPID) to push. - - name: vlan_tci + name: vlan-tci type: u16 byte-order: big-endian doc: Tag control identifier (TCI) to push.
Signature · 1 line
2.49.0
Re: [PATCH net 06/10] netlink: specs: ovs_flow: replace underscores with dashes in names
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 93b230b549bc ("netlink: specs: add ynl spec for ovs_flow")Signed-off-by Jakub Kicinski <[email protected]>
Re: [PATCH net 06/10] netlink: specs: ovs_flow: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 35 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 93b230b549bc ("netlink: specs: add ynl spec for ovs_flow")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/ovs_flow.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Documentation/netlink/specs/ovs_flow.yaml +1
-2@@ -216,7 +216,7 @@ uapi-header: linux/openvswitch.h type: struct members: - - name: nd_target + name: nd-target type: binary len: 16 byte-order: big-endian@@ -258,12 +258,12 @@ uapi-header: linux/openvswitch.h type: struct members: - - name: vlan_tpid
Documentation/netlink/specs/ovs_flow.yaml uapi-header: linux/openvswitch.h · line 269
Quoted 10 lines
Documentation/netlink/specs/ovs_flow.yaml +2
-1+ name: vlan-tpid type: u16 byte-order: big-endian doc: Tag protocol identifier (TPID) to push. - - name: vlan_tci + name: vlan-tci type: u16 byte-order: big-endian doc: Tag control identifier (TCI) to push.
This makes naming consistent across the attributes, which is good.
Re: [PATCH net 06/10] netlink: specs: ovs_flow: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes 93b230b549bc ("netlink: specs: add ynl spec for ovs_flow")Signed-off-by Jakub Kicinski <[email protected]>
Quoted 7 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
---
The change makes sense to me.
Jakub Kicinski
maintainerPATCH 7/10 netlink: specs: mptcp: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/mptcp_pm.yaml | 8 ++++---- include/uapi/linux/mptcp_pm.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
Documentation/netlink/specs/mptcp_pm.yaml +4 -4
@@ -57,21 +57,21 @@ cmd-cnt-name: --mptcp-pm-cmd-after-last doc: >- A new subflow has been established. 'error' should not be set. Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | - daddr6, sport, dport, backup, if_idx [, error]. + daddr6, sport, dport, backup, if-idx [, error]. - name: sub-closed doc: >- A subflow has been closed. An error (copy of sk_err) could be set if an error has been detected for this subflow. Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | - daddr6, sport, dport, backup, if_idx [, error]. + daddr6, sport, dport, backup, if-idx [, error]. - name: sub-priority value: 13 doc: >- The priority of a subflow has changed. 'error' should not be set. Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | - daddr6, sport, dport, backup, if_idx [, error]. + daddr6, sport, dport, backup, if-idx [, error]. - name: listener-created value: 15
@@ -255,7 +255,7 @@ cmd-cnt-name: --mptcp-pm-cmd-after-last name: timeout type: u32 - - name: if_idx + name: if-idx type: u32 - name: reset-reason
include/uapi/linux/mptcp_pm.h +3 -3
@@ -27,14 +27,14 @@* token, rem_id. * @MPTCP_EVENT_SUB_ESTABLISHED: A new subflow has been established. 'error' * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 | -* saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error]. +* saddr6, daddr4 | daddr6, sport, dport, backup, if-idx [, error]. * @MPTCP_EVENT_SUB_CLOSED: A subflow has been closed. An error (copy of * sk_err) could be set if an error has been detected for this subflow. * Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | -* daddr6, sport, dport, backup, if_idx [, error]. +* daddr6, sport, dport, backup, if-idx [, error]. * @MPTCP_EVENT_SUB_PRIORITY: The priority of a subflow has changed. 'error' * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 | -* saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error]. +* saddr6, daddr4 | daddr6, sport, dport, backup, if-idx [, error]. * @MPTCP_EVENT_LISTENER_CREATED: A new PM listener is created. Attributes: * family, sport, saddr4 | saddr6. * @MPTCP_EVENT_LISTENER_CLOSED: A PM listener is closed. Attributes: family,
Signature · 1 line
2.49.0
Re: [PATCH net 07/10] netlink: specs: mptcp: replace underscores with dashes in names
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")Signed-off-by Jakub Kicinski <[email protected]>
Quoted 7 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Re: [PATCH net 07/10] netlink: specs: mptcp: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")Signed-off-by Jakub Kicinski <[email protected]>
Re: [PATCH net 07/10] netlink: specs: mptcp: replace underscores with dashes in names
In reply to Jakub KicinskiHi Jakub,
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")Signed-off-by Jakub Kicinski <[email protected]>
Thank you! Looks good to me!
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Jakub Kicinski
maintainerPATCH 8/10 netlink: specs: rt-link: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/rt-link.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/netlink/specs/rt-link.yaml +2 -2
@@ -603,7 +603,7 @@ protonum: 0 name: optmask type: u32 - - name: if_stats_msg + name: if-stats-msg type: struct members: -
@@ -2486,7 +2486,7 @@ protonum: 0 name: getstats doc: Get / dump link stats. attribute-set: stats-attrs - fixed-header: if_stats_msg + fixed-header: if-stats-msg do: request: value: 94
Signature · 1 line
2.49.0
Re: [PATCH net 08/10] netlink: specs: rt-link: replace underscores with dashes in names
Quoted 28 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes b2f63d904e72 ("doc/netlink: Add spec for rt link messages")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]--- Documentation/netlink/specs/rt-link.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/netlink/specs/rt-link.yaml +1
-1@@ -603,7 +603,7 @@ protonum: 0 name: optmask type: u32 - - name: if_stats_msg + name: if-stats-msg type: struct members: -
Documentation/netlink/specs/rt-link.yaml protonum: 0 · line 2492
Quoted 8 lines
Documentation/netlink/specs/rt-link.yaml +1
-1@@ -2486,7 +2486,7 @@ protonum: 0 name: getstats doc: Get / dump link stats. attribute-set: stats-attrs - fixed-header: if_stats_msg + fixed-header: if-stats-msg do: request: value: 94
Re: [PATCH net 08/10] netlink: specs: rt-link: replace underscores with dashes in names
In reply to Jakub KicinskiQuoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes b2f63d904e72 ("doc/netlink: Add spec for rt link messages")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 9/10 netlink: specs: tc: replace underscores with dashes in names
In reply to Jakub KicinskiWe're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
---
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/tc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/netlink/specs/tc.yaml +2 -2
@@ -232,7 +232,7 @@ protonum: 0 type: u8 doc: log(P_max / (qth-max - qth-min)) - - name: Scell_log + name: Scell-log type: u8 doc: cell size for idle damping -
@@ -253,7 +253,7 @@ protonum: 0 name: DPs type: u32 - - name: def_DP + name: def-DP type: u32 - name: grio
Signature · 1 line
2.49.0
Re: [PATCH net 09/10] netlink: specs: tc: replace underscores with dashes in names
Quoted 7 lines · Jakub Kicinski
We're trying to add a strict regexp for the name format in the spec. Underscores will not be allowed, dashes should be used instead. This makes no difference to C (codegen, if used, replaces special chars in names) but it gives more uniform naming in Python.
Fixes a1bcfde83669 ("doc/netlink/specs: Add a spec for tc")Signed-off-by Jakub Kicinski <[email protected]>
Jakub Kicinski
maintainerPATCH 10/10 netlink: specs: enforce strict naming of properties
In reply to Jakub KicinskiAdd a regexp to make sure all names which may end up being visible to the user consist of lower case characters, numbers and dashes. Underscores keep sneaking into the specs, which is not visible in the C code but makes the Python and alike inconsistent.
Note that starting with a number is okay, as in C the full name will include the family name.
For legacy families we can't enforce the naming in the family name or the multicast group names, as these are part of the binary uAPI of the kernel.
For classic netlink we need to allow capital letters in names of struct members. TC has some structs with capitalized members.
--- Documentation/netlink/genetlink-legacy.yaml | 15 +++++++++------ Documentation/netlink/genetlink.yaml | 17 ++++++++++------- Documentation/netlink/netlink-raw.yaml | 18 ++++++++++++------ 3 files changed, 31 insertions(+), 19 deletions(-)
Documentation/netlink/genetlink-legacy.yaml +9 -6
@@ -6,6 +6,9 @@ $schema: https://json-schema.org/draft-07/schema # Common defines $defs: + name: + type: string + pattern: ^[0-9a-z-]+$ uint: type: integer minimum: 0
@@ -76,7 +79,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' header: description: For C-compatible languages, header which already defines this value. type: string
@@ -103,7 +106,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' value: type: integer doc:
@@ -132,7 +135,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' type: description: The netlink attribute type enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
@@ -169,7 +172,7 @@ additionalProperties: False name: description: | Name used when referring to this space in other definitions, not used outside of the spec. - type: string + $ref: '#/$defs/name' name-prefix: description: | Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
@@ -206,7 +209,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, bitfield32,
@@ -348,7 +351,7 @@ additionalProperties: False properties: name: description: Name of the operation, also defining its C enum value in uAPI. - type: string + $ref: '#/$defs/name' doc: description: Documentation for the command. type: string
Documentation/netlink/genetlink.yaml +10 -7
@@ -6,6 +6,9 @@ $schema: https://json-schema.org/draft-07/schema # Common defines $defs: + name: + type: string + pattern: ^[0-9a-z-]+$ uint: type: integer minimum: 0
@@ -29,7 +32,7 @@ additionalProperties: False properties: name: description: Name of the genetlink family. - type: string + $ref: '#/$defs/name' doc: type: string protocol:
@@ -48,7 +51,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' header: description: For C-compatible languages, header which already defines this value. type: string
@@ -75,7 +78,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' value: type: integer doc:
@@ -96,7 +99,7 @@ additionalProperties: False name: description: | Name used when referring to this space in other definitions, not used outside of the spec. - type: string + $ref: '#/$defs/name' name-prefix: description: | Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
@@ -121,7 +124,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' type: &attr-type enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s8, s16, s32, s64,
@@ -243,7 +246,7 @@ additionalProperties: False properties: name: description: Name of the operation, also defining its C enum value in uAPI. - type: string + $ref: '#/$defs/name' doc: description: Documentation for the command. type: string
@@ -327,7 +330,7 @@ additionalProperties: False name: description: | The name for the group, used to form the define and the value of the define. - type: string + $ref: '#/$defs/name' flags: *cmd_flags kernel-family:
Documentation/netlink/netlink-raw.yaml +12 -6
@@ -6,6 +6,12 @@ $schema: https://json-schema.org/draft-07/schema # Common defines $defs: + name: + type: string + pattern: ^[0-9a-z-]+$ + name-cap: + type: string + pattern: ^[0-9a-zA-Z-]+$ uint: type: integer minimum: 0
@@ -71,7 +77,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' header: description: For C-compatible languages, header which already defines this value. type: string
@@ -98,7 +104,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' value: type: integer doc:
@@ -124,7 +130,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name-cap' type: description: | The netlink attribute type. Members of type 'binary' or 'pad'
@@ -183,7 +189,7 @@ additionalProperties: False name: description: | Name used when referring to this space in other definitions, not used outside of the spec. - type: string + $ref: '#/$defs/name' name-prefix: description: | Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
@@ -220,7 +226,7 @@ additionalProperties: False additionalProperties: False properties: name: - type: string + $ref: '#/$defs/name' type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, bitfield32,
@@ -408,7 +414,7 @@ additionalProperties: False properties: name: description: Name of the operation, also defining its C enum value in uAPI. - type: string + $ref: '#/$defs/name' doc: description: Documentation for the command. type: string
Signature · 1 line
2.49.0
Quoted 8 lines · Jakub Kicinski
Add a regexp to make sure all names which may end up being visible to the user consist of lower case characters, numbers and dashes. Underscores keep sneaking into the specs, which is not visible in the C code but makes the Python and alike inconsistent.
Note that starting with a number is okay, as in C the full name will include the family name.
Quoted 8 lines
For legacy families we can't enforce the naming in the family name or the multicast group names, as these are part of the binary uAPI of the kernel.
For classic netlink we need to allow capital letters in names of struct members. TC has some structs with capitalized members.
Signed-off-by Jakub Kicinski <[email protected]>
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 24 Jun 2025 14:09:52 -0700 you wrote:
I got annoyed once again by the name properties in the ethtool spec which use underscore instead of dash. I previously assumed that there is a lot of such properties in the specs so fixing them now would be near impossible. On a closer look, however, I only found 22 (rough grep suggests we have ~4.8k names in the specs, so bad ones are just 0.46%).
[...]
Here is the summary with links:
- [net,01/10] netlink: specs: nfsd: replace underscores with dashes in names
https://git.kernel.org/netdev/net/c/2434ccb94dfc - [net,02/10] netlink: specs: fou: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/791a9ed0a40d - [net,03/10] netlink: specs: ethtool: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/07caaf875c93 - [net,04/10] netlink: specs: dpll: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/354592f19c7b - [net,05/10] netlink: specs: devlink: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/940768094514 - [net,06/10] netlink: specs: ovs_flow: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/e40d3d0931d2 - [net,07/10] netlink: specs: mptcp: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/9e6dd4c256d0 - [net,08/10] netlink: specs: rt-link: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/8d7e211ea925 - [net,09/10] netlink: specs: tc: replace underscores with dashes in names https://git.kernel.org/netdev/net/c/eef0eaeca7fa - [net,10/10] netlink: specs: enforce strict naming of properties https://git.kernel.org/netdev/net/c/af852f1f1c95
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html