Commit 6907217a authored by Donald Hunter's avatar Donald Hunter Committed by Jakub Kicinski

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.
Signed-off-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20230615151405.77649-1-donald.hunter@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e16ad981
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
name: ovs_datapath name: ovs_datapath
version: 2 version: 2
protocol: genetlink-legacy protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: doc:
OVS datapath configuration over generic netlink. OVS datapath configuration over generic netlink.
...@@ -18,6 +19,7 @@ definitions: ...@@ -18,6 +19,7 @@ definitions:
- -
name: user-features name: user-features
type: flags type: flags
name-prefix: ovs-dp-f-
entries: entries:
- -
name: unaligned name: unaligned
...@@ -33,35 +35,37 @@ definitions: ...@@ -33,35 +35,37 @@ definitions:
doc: Allow per-cpu dispatch of upcalls doc: Allow per-cpu dispatch of upcalls
- -
name: datapath-stats name: datapath-stats
enum-name: ovs-dp-stats
type: struct type: struct
members: members:
- -
name: hit name: n-hit
type: u64 type: u64
- -
name: missed name: n-missed
type: u64 type: u64
- -
name: lost name: n-lost
type: u64 type: u64
- -
name: flows name: n-flows
type: u64 type: u64
- -
name: megaflow-stats name: megaflow-stats
enum-name: ovs-dp-megaflow-stats
type: struct type: struct
members: members:
- -
name: mask-hit name: n-mask-hit
type: u64 type: u64
- -
name: masks name: n-masks
type: u32 type: u32
- -
name: padding name: padding
type: u32 type: u32
- -
name: cache-hits name: n-cache-hit
type: u64 type: u64
- -
name: pad1 name: pad1
...@@ -70,6 +74,8 @@ definitions: ...@@ -70,6 +74,8 @@ definitions:
attribute-sets: attribute-sets:
- -
name: datapath name: datapath
name-prefix: ovs-dp-attr-
enum-name: ovs-datapath-attrs
attributes: attributes:
- -
name: name name: name
...@@ -101,12 +107,16 @@ attribute-sets: ...@@ -101,12 +107,16 @@ attribute-sets:
name: per-cpu-pids name: per-cpu-pids
type: binary type: binary
sub-type: u32 sub-type: u32
-
name: ifindex
type: u32
operations: operations:
fixed-header: ovs-header fixed-header: ovs-header
name-prefix: ovs-dp-cmd-
list: list:
- -
name: dp-get name: get
doc: Get / dump OVS data path configuration and state doc: Get / dump OVS data path configuration and state
value: 3 value: 3
attribute-set: datapath attribute-set: datapath
...@@ -125,7 +135,7 @@ operations: ...@@ -125,7 +135,7 @@ operations:
- per-cpu-pids - per-cpu-pids
dump: *dp-get-op dump: *dp-get-op
- -
name: dp-new name: new
doc: Create new OVS data path doc: Create new OVS data path
value: 1 value: 1
attribute-set: datapath attribute-set: datapath
...@@ -137,7 +147,7 @@ operations: ...@@ -137,7 +147,7 @@ operations:
- upcall-pid - upcall-pid
- user-features - user-features
- -
name: dp-del name: del
doc: Delete existing OVS data path doc: Delete existing OVS data path
value: 2 value: 2
attribute-set: datapath attribute-set: datapath
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
name: ovs_flow name: ovs_flow
version: 1 version: 1
protocol: genetlink-legacy protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: doc:
OVS flow configuration over generic netlink. OVS flow configuration over generic netlink.
...@@ -67,6 +68,7 @@ definitions: ...@@ -67,6 +68,7 @@ definitions:
enum: ovs-frag-type enum: ovs-frag-type
- -
name: ovs-frag-type name: ovs-frag-type
name-prefix: ovs-frag-type-
type: enum type: enum
entries: entries:
- -
...@@ -166,6 +168,7 @@ definitions: ...@@ -166,6 +168,7 @@ definitions:
doc: Tag control identifier (TCI) to push. doc: Tag control identifier (TCI) to push.
- -
name: ovs-ufid-flags name: ovs-ufid-flags
name-prefix: ovs-ufid-f-
type: flags type: flags
entries: entries:
- omit-key - omit-key
...@@ -176,7 +179,7 @@ definitions: ...@@ -176,7 +179,7 @@ definitions:
type: struct type: struct
members: members:
- -
name: hash-algorithm name: hash-alg
type: u32 type: u32
doc: Algorithm used to compute hash prior to recirculation. doc: Algorithm used to compute hash prior to recirculation.
- -
...@@ -198,13 +201,13 @@ definitions: ...@@ -198,13 +201,13 @@ definitions:
type: struct type: struct
members: members:
- -
name: lse name: mpls-lse
type: u32 type: u32
byte-order: big-endian byte-order: big-endian
doc: | doc: |
MPLS label stack entry to push MPLS label stack entry to push
- -
name: ethertype name: mpls-ethertype
type: u32 type: u32
byte-order: big-endian byte-order: big-endian
doc: | doc: |
...@@ -216,13 +219,13 @@ definitions: ...@@ -216,13 +219,13 @@ definitions:
type: struct type: struct
members: members:
- -
name: lse name: mpls-lse
type: u32 type: u32
byte-order: big-endian byte-order: big-endian
doc: | doc: |
MPLS label stack entry to push MPLS label stack entry to push
- -
name: ethertype name: mpls-ethertype
type: u32 type: u32
byte-order: big-endian byte-order: big-endian
doc: | doc: |
...@@ -237,6 +240,7 @@ definitions: ...@@ -237,6 +240,7 @@ definitions:
- -
name: ct-state-flags name: ct-state-flags
type: flags type: flags
name-prefix: ovs-cs-f-
entries: entries:
- -
name: new name: new
...@@ -266,6 +270,8 @@ definitions: ...@@ -266,6 +270,8 @@ definitions:
attribute-sets: attribute-sets:
- -
name: flow-attrs name: flow-attrs
enum-name: ovs-flow-attr
name-prefix: ovs-flow-attr-
attributes: attributes:
- -
name: key name: key
...@@ -352,6 +358,8 @@ attribute-sets: ...@@ -352,6 +358,8 @@ attribute-sets:
- -
name: key-attrs name: key-attrs
enum-name: ovs-key-attr
name-prefix: ovs-key-attr-
attributes: attributes:
- -
name: encap name: encap
...@@ -481,6 +489,8 @@ attribute-sets: ...@@ -481,6 +489,8 @@ attribute-sets:
doc: struct ovs_key_ipv6_exthdr doc: struct ovs_key_ipv6_exthdr
- -
name: action-attrs name: action-attrs
enum-name: ovs-action-attr
name-prefix: ovs-action-attr-
attributes: attributes:
- -
name: output name: output
...@@ -608,6 +618,8 @@ attribute-sets: ...@@ -608,6 +618,8 @@ attribute-sets:
nested-attributes: dec-ttl-attrs nested-attributes: dec-ttl-attrs
- -
name: tunnel-key-attrs name: tunnel-key-attrs
enum-name: ovs-tunnel-key-attr
name-prefix: ovs-tunnel-key-attr-
attributes: attributes:
- -
name: id name: id
...@@ -676,6 +688,8 @@ attribute-sets: ...@@ -676,6 +688,8 @@ attribute-sets:
type: flag type: flag
- -
name: check-pkt-len-attrs name: check-pkt-len-attrs
enum-name: ovs-check-pkt-len-attr
name-prefix: ovs-check-pkt-len-attr-
attributes: attributes:
- -
name: pkt-len name: pkt-len
...@@ -690,6 +704,8 @@ attribute-sets: ...@@ -690,6 +704,8 @@ attribute-sets:
nested-attributes: action-attrs nested-attributes: action-attrs
- -
name: sample-attrs name: sample-attrs
enum-name: ovs-sample-attr
name-prefix: ovs-sample-attr-
attributes: attributes:
- -
name: probability name: probability
...@@ -700,6 +716,8 @@ attribute-sets: ...@@ -700,6 +716,8 @@ attribute-sets:
nested-attributes: action-attrs nested-attributes: action-attrs
- -
name: userspace-attrs name: userspace-attrs
enum-name: ovs-userspace-attr
name-prefix: ovs-userspace-attr-
attributes: attributes:
- -
name: pid name: pid
...@@ -715,6 +733,8 @@ attribute-sets: ...@@ -715,6 +733,8 @@ attribute-sets:
type: flag type: flag
- -
name: ovs-nsh-key-attrs name: ovs-nsh-key-attrs
enum-name: ovs-nsh-key-attr
name-prefix: ovs-nsh-key-attr-
attributes: attributes:
- -
name: base name: base
...@@ -727,6 +747,8 @@ attribute-sets: ...@@ -727,6 +747,8 @@ attribute-sets:
type: binary type: binary
- -
name: ct-attrs name: ct-attrs
enum-name: ovs-ct-attr
name-prefix: ovs-ct-attr-
attributes: attributes:
- -
name: commit name: commit
...@@ -758,13 +780,15 @@ attribute-sets: ...@@ -758,13 +780,15 @@ attribute-sets:
type: string type: string
- -
name: nat-attrs name: nat-attrs
enum-name: ovs-nat-attr
name-prefix: ovs-nat-attr-
attributes: attributes:
- -
name: src name: src
type: binary type: flag
- -
name: dst name: dst
type: binary type: flag
- -
name: ip-min name: ip-min
type: binary type: binary
...@@ -773,21 +797,23 @@ attribute-sets: ...@@ -773,21 +797,23 @@ attribute-sets:
type: binary type: binary
- -
name: proto-min name: proto-min
type: binary type: u16
- -
name: proto-max name: proto-max
type: binary type: u16
- -
name: persistent name: persistent
type: binary type: flag
- -
name: proto-hash name: proto-hash
type: binary type: flag
- -
name: proto-random name: proto-random
type: binary type: flag
- -
name: dec-ttl-attrs name: dec-ttl-attrs
enum-name: ovs-dec-ttl-attr
name-prefix: ovs-dec-ttl-attr-
attributes: attributes:
- -
name: action name: action
...@@ -795,16 +821,19 @@ attribute-sets: ...@@ -795,16 +821,19 @@ attribute-sets:
nested-attributes: action-attrs nested-attributes: action-attrs
- -
name: vxlan-ext-attrs name: vxlan-ext-attrs
enum-name: ovs-vxlan-ext-
name-prefix: ovs-vxlan-ext-
attributes: attributes:
- -
name: gbp name: gbp
type: u32 type: u32
operations: operations:
name-prefix: ovs-flow-cmd-
fixed-header: ovs-header fixed-header: ovs-header
list: list:
- -
name: flow-get name: get
doc: Get / dump OVS flow configuration and state doc: Get / dump OVS flow configuration and state
value: 3 value: 3
attribute-set: flow-attrs attribute-set: flow-attrs
...@@ -824,6 +853,19 @@ operations: ...@@ -824,6 +853,19 @@ operations:
- stats - stats
- actions - actions
dump: *flow-get-op dump: *flow-get-op
-
name: new
doc: Create OVS flow configuration in a data path
value: 1
attribute-set: flow-attrs
do:
request:
attributes:
- dp-ifindex
- key
- ufid
- mask
- actions
mcast-groups: mcast-groups:
list: list:
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
name: ovs_vport name: ovs_vport
version: 2 version: 2
protocol: genetlink-legacy protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: doc:
OVS vport configuration over generic netlink. OVS vport configuration over generic netlink.
...@@ -18,10 +19,13 @@ definitions: ...@@ -18,10 +19,13 @@ definitions:
- -
name: vport-type name: vport-type
type: enum type: enum
enum-name: ovs-vport-type
name-prefix: ovs-vport-type-
entries: [ unspec, netdev, internal, gre, vxlan, geneve ] entries: [ unspec, netdev, internal, gre, vxlan, geneve ]
- -
name: vport-stats name: vport-stats
type: struct type: struct
enum-name: ovs-vport-stats
members: members:
- -
name: rx-packets name: rx-packets
...@@ -51,6 +55,8 @@ definitions: ...@@ -51,6 +55,8 @@ definitions:
attribute-sets: attribute-sets:
- -
name: vport-options name: vport-options
enum-name: ovs-vport-options
name-prefix: ovs-tunnel-attr-
attributes: attributes:
- -
name: dst-port name: dst-port
...@@ -60,6 +66,8 @@ attribute-sets: ...@@ -60,6 +66,8 @@ attribute-sets:
type: u32 type: u32
- -
name: upcall-stats name: upcall-stats
enum-name: ovs-vport-upcall-attr
name-prefix: ovs-vport-upcall-attr-
attributes: attributes:
- -
name: success name: success
...@@ -70,6 +78,8 @@ attribute-sets: ...@@ -70,6 +78,8 @@ attribute-sets:
type: u64 type: u64
- -
name: vport name: vport
name-prefix: ovs-vport-attr-
enum-name: ovs-vport-attr
attributes: attributes:
- -
name: port-no name: port-no
...@@ -108,9 +118,10 @@ attribute-sets: ...@@ -108,9 +118,10 @@ attribute-sets:
nested-attributes: upcall-stats nested-attributes: upcall-stats
operations: operations:
name-prefix: ovs-vport-cmd-
list: list:
- -
name: vport-get name: get
doc: Get / dump OVS vport configuration and state doc: Get / dump OVS vport configuration and state
value: 3 value: 3
attribute-set: vport attribute-set: vport
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment