Skip to contentSkip to conversation

netlink: specs: fixup openvswitch specs for code generation

PATCH Applied Donald Hunter 3 participants 3 messages Jun 15, 2023 – Jun 17, 2023

Subsystems (3)
lore
Share & tools
lore

Donald Hunter

author maintainer
#0 lore raw

PATCH 1/1 netlink: specs: fixup openvswitch specs for code generation

Refine the ovs_* specs to align exactly with the ovs netlink UAPI definitions to enable code generation.

---
 Documentation/netlink/specs/ovs_datapath.yaml | 30 +++++---
 Documentation/netlink/specs/ovs_flow.yaml     | 68 +++++++++++++++----
 Documentation/netlink/specs/ovs_vport.yaml    | 13 +++-
 3 files changed, 87 insertions(+), 24 deletions(-)
Documentation/netlink/specs/ovs_datapath.yaml +20 -10
index 6d71db8c4416..f709c26c3e92 100644
@@ -3,6 +3,7 @@
 name: ovs_datapath
 version: 2
 protocol: genetlink-legacy
+uapi-header: linux/openvswitch.h
 
 doc:
   OVS datapath configuration over generic netlink.
@@ -18,6 +19,7 @@ definitions:
   -
     name: user-features
     type: flags
+    name-prefix: ovs-dp-f-
     entries:
       -
         name: unaligned
@@ -33,35 +35,37 @@ definitions:
         doc: Allow per-cpu dispatch of upcalls
   -
     name: datapath-stats
+    enum-name: ovs-dp-stats
     type: struct
     members:
       -
-        name: hit
+        name: n-hit
         type: u64
       -
-        name: missed
+        name: n-missed
         type: u64
       -
-        name: lost
+        name: n-lost
         type: u64
       -
-        name: flows
+        name: n-flows
         type: u64
   -
     name: megaflow-stats
+    enum-name: ovs-dp-megaflow-stats
     type: struct
     members:
       -
-        name: mask-hit
+        name: n-mask-hit
         type: u64
       -
-        name: masks
+        name: n-masks
         type: u32
       -
         name: padding
         type: u32
       -
-        name: cache-hits
+        name: n-cache-hit
         type: u64
       -
         name: pad1
@@ -70,6 +74,8 @@ definitions:
 attribute-sets:
   -
     name: datapath
+    name-prefix: ovs-dp-attr-
+    enum-name: ovs-datapath-attrs
     attributes:
       -
         name: name
@@ -101,12 +107,16 @@ attribute-sets:
         name: per-cpu-pids
         type: binary
         sub-type: u32
+      -
+        name: ifindex
+        type: u32
 
 operations:
   fixed-header: ovs-header
+  name-prefix: ovs-dp-cmd-
   list:
     -
-      name: dp-get
+      name: get
       doc: Get / dump OVS data path configuration and state
       value: 3
       attribute-set: datapath
@@ -125,7 +135,7 @@ operations:
             - per-cpu-pids
       dump: *dp-get-op
     -
-      name: dp-new
+      name: new
       doc: Create new OVS data path
       value: 1
       attribute-set: datapath
@@ -137,7 +147,7 @@ operations:
             - upcall-pid
             - user-features
     -
-      name: dp-del
+      name: del
       doc: Delete existing OVS data path
       value: 2
       attribute-set: datapath
Documentation/netlink/specs/ovs_flow.yaml +55 -13

222 lines not on this page · raw message

Documentation/netlink/specs/ovs_vport.yaml +12 -1
index 8e55622ddf11..17336455bec1 100644
@@ -3,6 +3,7 @@
 name: ovs_vport
 version: 2
 protocol: genetlink-legacy
+uapi-header: linux/openvswitch.h
 
 doc:
   OVS vport configuration over generic netlink.
@@ -18,10 +19,13 @@ definitions:
   -
     name: vport-type
     type: enum
+    enum-name: ovs-vport-type
+    name-prefix: ovs-vport-type-
     entries: [ unspec, netdev, internal, gre, vxlan, geneve ]
   -
     name: vport-stats
     type: struct
+    enum-name: ovs-vport-stats
     members:
       -
         name: rx-packets
@@ -51,6 +55,8 @@ definitions:
 attribute-sets:
   -
     name: vport-options
+    enum-name: ovs-vport-options
+    name-prefix: ovs-tunnel-attr-
     attributes:
       -
         name: dst-port
@@ -60,6 +66,8 @@ attribute-sets:
         type: u32
   -
     name: upcall-stats
+    enum-name: ovs-vport-upcall-attr
+    name-prefix: ovs-vport-upcall-attr-
     attributes:
       -
         name: success
@@ -70,6 +78,8 @@ attribute-sets:
         type: u64
   -
     name: vport
+    name-prefix: ovs-vport-attr-
+    enum-name: ovs-vport-attr
     attributes:
       -
         name: port-no
@@ -108,9 +118,10 @@ attribute-sets:
         nested-attributes: upcall-stats
 
 operations:
+  name-prefix: ovs-vport-cmd-
   list:
     -
-      name: vport-get
+      name: get
       doc: Get / dump OVS vport configuration and state
       value: 3
       attribute-set: vport
Signature · 1 line
2.39.0
maintainer
#1 lore raw
Quoted 2 lines · On Thu, 15 Jun 2023 16:14:05 +0100 Donald Hunter wrote:

Refine the ovs_* specs to align exactly with the ovs netlink UAPI definitions to enable code generation.

Hah, the C code gen really tells you if you got the spec right ;)

Changes LGTM!

#2 lore raw
In reply to Donald Hunter
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 9 lines · On Thu, 15 Jun 2023 16:14:05 +0100 you wrote:

Refine the ovs_* specs to align exactly with the ovs netlink UAPI definitions to enable code generation.

---
 Documentation/netlink/specs/ovs_datapath.yaml | 30 +++++---
 Documentation/netlink/specs/ovs_flow.yaml     | 68 +++++++++++++++----
 Documentation/netlink/specs/ovs_vport.yaml    | 13 +++-
 3 files changed, 87 insertions(+), 24 deletions(-)

Here is the summary with links:
- [net-next,v1] netlink: specs: fixup openvswitch specs for code generation

    https://git.kernel.org/netdev/net-next/c/6907217a8054

You are awesome, thank you!

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