Subject: Re: [PATCH net-next v1 2/2] netlink: specs: Add a spec for FIB rule management

From: Ido Schimmel <[email-masked]>
Date: Mon, 4 Nov 2024 20:24:06 +0200

On Mon, Nov 04, 2024 at 04:53:52PM +0000, Donald Hunter wrote:
> Add a YNL spec for FIB rules:
> 
> ./tools/net/ynl/cli.py \
>     --spec Documentation/netlink/specs/rt_rule.yaml \
>     --dump getrule --json '{"family": 2}'
> 
> [{'action': 'to-tbl',
>   'dst-len': 0,
>   'family': 2,
>   'flags': 0,
>   'protocol': 2,
>   'src-len': 0,
>   'suppress-prefixlen': '0xffffffff',
>   'table': 255,
>   'tos': 0},
>   ... ]
> 
> Signed-off-by: Donald Hunter <[email-masked]>

[...]

> +attribute-sets:
> +  -
> +    name: fib-rule-attrs
> +    attributes:
> +      -
> +        name: dst
> +        type: u32
> +      -
> +        name: src
> +        type: u32
> +      -
> +        name: iifname
> +        type: string
> +      -
> +        name: goto
> +        type: u32
> +      -
> +        name: unused2
> +        type: pad
> +      -
> +        name: priority
> +        type: u32
> +      -
> +        name: unused3
> +        type: pad
> +      -
> +        name: unused4
> +        type: pad
> +      -
> +        name: unused5
> +        type: pad
> +      -
> +        name: fwmark
> +        type: u32
> +        display-hint: hex
> +      -
> +        name: flow
> +        type: u32
> +      -
> +        name: tun-id
> +        type: u64
> +      -
> +        name: suppress-ifgroup
> +        type: u32
> +      -
> +        name: suppress-prefixlen
> +        type: u32
> +        display-hint: hex
> +      -
> +        name: table
> +        type: u32
> +      -
> +        name: fwmask
> +        type: u32
> +        display-hint: hex
> +      -
> +        name: oifname
> +        type: string
> +      -
> +        name: pad
> +        type: pad
> +      -
> +        name: l3mdev
> +        type: u8
> +      -
> +        name: uid-range
> +        type: binary
> +        struct: fib-rule-uid-range
> +      -
> +        name: protocol
> +        type: u8
> +      -
> +        name: ip-proto
> +        type: u8
> +      -
> +        name: sport-range
> +        type: binary
> +        struct: fib-rule-port-range
> +      -
> +        name: dport-range
> +        type: binary
> +        struct: fib-rule-port-range

Donald,

We added a new DSCP attribute in the last release. Can you please
include it in the spec? Tested the following diff [1].

Thanks!

[1]
diff --git a/Documentation/netlink/specs/rt_rule.yaml b/Documentation/netlink/specs/rt_rule.yaml
index 736bcdb25738..8d1a594e851d 100644
--- a/Documentation/netlink/specs/rt_rule.yaml
+++ b/Documentation/netlink/specs/rt_rule.yaml
@@ -169,6 +169,9 @@ attribute-sets:
         name: dport-range
         type: binary
         struct: fib-rule-port-range
+      -
+        name: dscp
+        type: u8
 
 operations:
   enum-model: directional
@@ -199,6 +202,7 @@ operations:
             - ip-proto
             - sport-range
             - dport-range
+            - dscp
     -
       name: newrule-ntf
       doc: Notify a rule creation