diff mbox series

[net-next] doc/netlink/specs: add netkit support to rt_link.yaml

Message ID 20240806104531.3296718-1-razor@blackwall.org (mailing list archive)
State Accepted
Commit 7d70ed9f9c6a9537379ff645d6befea4c203aa98
Delegated to: Netdev Maintainers
Headers show
Series [net-next] doc/netlink/specs: add netkit support to rt_link.yaml | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: donald.hunter@gmail.com
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 59 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-06--15-00 (tests: 707)

Commit Message

Nikolay Aleksandrov Aug. 6, 2024, 10:45 a.m. UTC
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"
    }
  },
  ...

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
---
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(+)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 8, 2024, 3:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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"
>     }
>   },
>   ...
> 
> [...]

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!
diff mbox series

Patch

diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml
index de08c12fd56f..0c4d5d40cae9 100644
--- a/Documentation/netlink/specs/rt_link.yaml
+++ b/Documentation/netlink/specs/rt_link.yaml
@@ -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: