Skip to contentSkip to conversation

netlink: specs: enforce strict naming of properties

PATCH Applied Jakub Kicinski 12 participants 33 messages Jun 24, 2025 – Jun 26, 2025

Subsystems (7)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover 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
author maintainer
#1 lore raw

PATCH 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.

Fixes 13727f85b49b ("NFSD: introduce netlink stubs")

---
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
index c87658114852..8d1a3c01708f 100644
@@ -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
maintainer Reviewed-by on v1 1/10
#2 lore raw

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")
Reviewed-by on v1 1/10
#3 lore raw

Re: [PATCH net 01/10] netlink: specs: nfsd: replace underscores with dashes in names

In reply to Jakub Kicinski
Quoted 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")

---
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
index c87658114852..8d1a3c01708f 100644
@@ -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
Reviewed-by on v1 1/10
#4 lore raw

Re: [PATCH net 01/10] netlink: specs: nfsd: replace underscores with dashes in names

In reply to Jakub Kicinski
Quoted 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")

---
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
index c87658114852..8d1a3c01708f 100644
@@ -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
author maintainer
#5 lore raw

PATCH 2/10 netlink: specs: fou: replace underscores with dashes in names

In reply to 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")

---
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
index 0af5ab842c04..b02ab19817d3 100644
@@ -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
maintainer Reviewed-by on v1 2/10
#6 lore raw

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")
author maintainer
#7 lore raw

PATCH 3/10 netlink: specs: ethtool: replace underscores with dashes in names

In reply to 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")

---
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
index 72a076b0e1b5..348c6ad548f5 100644
@@ -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
index f439c434ba36..648ff50bc1c3 100755
@@ -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
Reviewed-by on v1 3/10
#8 lore raw

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 transceiver

modules' 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
author maintainer
#9 lore raw

Re: [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 transceiver

modules' 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.

maintainer Reviewed-by on v1 3/10
#10 lore raw

Re: [PATCH net 03/10] netlink: specs: ethtool: replace underscores with dashes in names

In reply to Jakub Kicinski
Quoted 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")
author maintainer
#11 lore raw

PATCH 4/10 netlink: specs: dpll: replace underscores with dashes in names

In reply to 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")

---
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
index 8feefeae5376..f434140b538e 100644
@@ -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
maintainer Reviewed-by on v1 4/10
#12 lore raw

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")

---
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
index 8feefeae5376..f434140b538e 100644

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
maintainer Reviewed-by on v1 4/10
#13 lore raw

Re: [PATCH net 04/10] netlink: specs: dpll: replace underscores with dashes in names

In reply to Jakub Kicinski
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 3badff3a25d8 ("dpll: spec: Add Netlink spec in YAML")
author maintainer
#14 lore raw

PATCH 5/10 netlink: specs: devlink: replace underscores with dashes in names

In reply to 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")

---
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
index 05fee1b7fe19..38ddc04f9e6d 100644
@@ -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
Reviewed-by on v1 5/10
#15 lore raw

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")

---
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
index 05fee1b7fe19..38ddc04f9e6d 100644
@@ -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
maintainer Reviewed-by on v1 5/10
#16 lore raw

Re: [PATCH net 05/10] netlink: specs: devlink: replace underscores with dashes in names

In reply to Jakub Kicinski
Quoted 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")
author maintainer
#17 lore raw

PATCH 6/10 netlink: specs: ovs_flow: replace underscores with dashes in names

In reply to 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")

---
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
index 46f5d1cd8a5f..7974aa7d8905 100644
@@ -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
maintainer Reviewed-by on v1 6/10
#18 lore raw

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")
Reviewed-by on v1 6/10
#19 lore raw

Re: [PATCH net 06/10] netlink: specs: ovs_flow: replace underscores with dashes in names

In reply to Jakub Kicinski
Quoted 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")

---
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
index 46f5d1cd8a5f..7974aa7d8905 100644
@@ -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.

Reviewed-by on v1 6/10
#20 lore raw

Re: [PATCH net 06/10] netlink: specs: ovs_flow: replace underscores with dashes in names

In reply to Jakub Kicinski
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")
Quoted 7 lines

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
---

The change makes sense to me.

author maintainer
#21 lore raw

PATCH 7/10 netlink: specs: mptcp: replace underscores with dashes in names

In reply to 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")

---
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
index dfd017780d2f..fb57860fe778 100644
@@ -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
index 84fa8a21dfd0..6ac84b2f636c 100644
@@ -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
Reviewed-by on v1 7/10
#22 lore raw

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")
Quoted 7 lines

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

maintainer Reviewed-by on v1 7/10
#23 lore raw

Re: [PATCH net 07/10] netlink: specs: mptcp: replace underscores with dashes in names

In reply to Jakub Kicinski
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")
maintainer Reviewed-by on v1 7/10
#24 lore raw

Re: [PATCH net 07/10] netlink: specs: mptcp: replace underscores with dashes in names

In reply to Jakub Kicinski

Hi 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")

Thank you! Looks good to me!

Cheers,
Matt

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

PATCH 8/10 netlink: specs: rt-link: replace underscores with dashes in names

In reply to 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")

---
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
index b41b31eebcae..28c4cf66517c 100644
@@ -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
Reviewed-by on v1 8/10
#26 lore raw

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")

---
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
index b41b31eebcae..28c4cf66517c 100644
@@ -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
maintainer Reviewed-by on v1 8/10
#27 lore raw

Re: [PATCH net 08/10] netlink: specs: rt-link: replace underscores with dashes in names

In reply to Jakub Kicinski
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 b2f63d904e72 ("doc/netlink: Add spec for rt link messages")
author maintainer
#28 lore raw

PATCH 9/10 netlink: specs: tc: replace underscores with dashes in names

In reply to 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")

---
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
index cb7ea7d62e56..42d74c9aeb54 100644
@@ -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
maintainer Reviewed-by on v1 9/10
#29 lore raw

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")
author maintainer
#30 lore raw

PATCH 10/10 netlink: specs: enforce strict naming of properties

In reply to 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.

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
index 4cbfe666e6f5..b29d62eefa16 100644
@@ -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
index 40efbbad76ab..7b1ec153e834 100644
@@ -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
index e34bf23897fa..246fa07bccf6 100644
@@ -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
maintainer Reviewed-by on v1 10/10
#31 lore raw
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.

#32 lore raw
In reply to Jakub Kicinski
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