Skip to contentSkip to conversation

doc/netlink/specs: add netkit support to rt_link.yaml

PATCH Applied Nikolay Aleksandrov 2 participants 2 messages Aug 6, 2024 – Aug 8, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc/netlink/specs: add netkit support to rt_link.yaml

Add netkit support to rt_link.yaml. Only forward(PASS) and blackhole(DROP) policies are allowed to be set by user-space so I've added only them to the yaml to avoid confusion.

Example:

  $ ./tools/net/ynl/cli.py \
     --spec Documentation/netlink/specs/rt_link.yaml \
     --do getlink --json '{"ifname": "netkit0"}' --output-json | jq
  ...
  "linkinfo": {
    "kind": "netkit",
    "data": {
      "primary": 1,
      "policy": "blackhole",
      "mode": "l2",
      "peer-policy": "forward"
    }
  },
  ...

---
This has been rotting in my tree for quite some time, sending out for reviews. :)

 Documentation/netlink/specs/rt_link.yaml | 41 ++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
Documentation/netlink/specs/rt_link.yaml +41 -0
index de08c12fd56f..0c4d5d40cae9 100644
@@ -903,6 +903,22 @@ definitions:
       - cfm-config
       - cfm-status
       - mst
+  -
+    name: netkit-policy
+    type: enum
+    entries:
+      -
+        name: forward
+        value: 0
+      -
+        name: blackhole
+        value: 2
+  -
+    name: netkit-mode
+    type: enum
+    entries:
+      - name: l2
+      - name: l3
 
 attribute-sets:
   -
@@ -2109,6 +2125,28 @@ attribute-sets:
       -
         name: id
         type: u32
+  -
+    name: linkinfo-netkit-attrs
+    name-prefix: ifla-netkit-
+    attributes:
+      -
+        name: peer-info
+        type: binary
+      -
+        name: primary
+        type: u8
+      -
+        name: policy
+        type: u32
+        enum: netkit-policy
+      -
+        name: peer-policy
+        type: u32
+        enum: netkit-policy
+      -
+        name: mode
+        type: u32
+        enum: netkit-mode
 
 sub-messages:
   -
@@ -2147,6 +2185,9 @@ sub-messages:
       -
         value: vrf
         attribute-set: linkinfo-vrf-attrs
+      -
+        value: netkit
+        attribute-set: linkinfo-netkit-attrs
   -
     name: linkinfo-member-data-msg
     formats:
Signature · 1 line
2.44.0
#1 lore raw
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 20 lines · On Tue, 6 Aug 2024 13:45:31 +0300 you wrote:

Add netkit support to rt_link.yaml. Only forward(PASS) and blackhole(DROP) policies are allowed to be set by user-space so I've added only them to the yaml to avoid confusion.

Example:

  $ ./tools/net/ynl/cli.py \
     --spec Documentation/netlink/specs/rt_link.yaml \
     --do getlink --json '{"ifname": "netkit0"}' --output-json | jq
  ...
  "linkinfo": {
    "kind": "netkit",
    "data": {
      "primary": 1,
      "policy": "blackhole",
      "mode": "l2",
      "peer-policy": "forward"
    }
  },
  ...
Quoted 1 line

[...]

Here is the summary with links:
- [net-next] doc/netlink/specs: add netkit support to rt_link.yaml

    https://git.kernel.org/netdev/net-next/c/7d70ed9f9c6a

You are awesome, thank you!

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