netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] doc/netlink/specs: Add vlan attr in rt_link spec
@ 2024-03-08  4:15 Hangbin Liu
  2024-03-08 13:05 ` Donald Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2024-03-08  4:15 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Donald Hunter, Hangbin Liu, Jacob Keller, Jiri Pirko

With command:
 # ./tools/net/ynl/cli.py \
 --spec Documentation/netlink/specs/rt_link.yaml \
 --do getlink --json '{"ifname": "eno1.2"}'

Before:
Exception: No message format for 'vlan' in sub-message spec 'linkinfo-data-msg'

After:
 'linkinfo': {'data': {'flag': {'flags': {'bridge-binding',
                                          'gvrp',
                                          'reorder-hdr'},
                                'mask': 4294967295},
                       'id': 2,
                       'protocol': 129},
              'kind': 'vlan'},

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
Not sure if there is a proper way to show the mask and protocol
---
 Documentation/netlink/specs/rt_link.yaml | 69 ++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml
index 8e4d19adee8c..5559ea18ccc7 100644
--- a/Documentation/netlink/specs/rt_link.yaml
+++ b/Documentation/netlink/specs/rt_link.yaml
@@ -729,6 +729,42 @@ definitions:
       -
         name: filter-mask
         type: u32
+  -
+    name: ifla-vlan-flags
+    type: struct
+    members:
+      -
+        name: flags
+        type: u32
+        enum: vlan-flags
+        enum-as-flags: true
+      -
+        name: mask
+        type: u32
+  -
+    name: vlan-flags
+    type: flags
+    entries:
+      -
+        name: reorder-hdr
+      -
+        name: gvrp
+      -
+        name: loose-binding
+      -
+        name: mvrp
+      -
+        name: bridge-binding
+  -
+    name: ifla-vlan-qos-mapping
+    type: struct
+    members:
+      -
+        name: from
+        type: u32
+      -
+        name: to
+        type: u32
 
 
 attribute-sets:
@@ -1507,6 +1543,36 @@ attribute-sets:
       -
         name: num-disabled-queues
         type: u32
+  -
+    name: linkinfo-vlan-attrs
+    name-prefix: ifla-vlan-
+    attributes:
+      -
+        name: id
+        type: u16
+      -
+        name: flag
+        type: binary
+        struct: ifla-vlan-flags
+      -
+        name: egress-qos
+        type: nest
+        nested-attributes: ifla-vlan-qos
+      -
+        name: ingress-qos
+        type: nest
+        nested-attributes: ifla-vlan-qos
+      -
+        name: protocol
+        type: u16
+  -
+    name: ifla-vlan-qos
+    name-prefix: ifla-vlan-qos
+    attributes:
+      -
+        name: mapping
+        type: binary
+        struct: ifla-vlan-qos-mapping
   -
     name: linkinfo-vrf-attrs
     name-prefix: ifla-vrf-
@@ -1666,6 +1732,9 @@ sub-messages:
       -
         value: tun
         attribute-set: linkinfo-tun-attrs
+      -
+        value: vlan
+        attribute-set: linkinfo-vlan-attrs
       -
         value: vrf
         attribute-set: linkinfo-vrf-attrs
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-11 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08  4:15 [PATCH net-next] doc/netlink/specs: Add vlan attr in rt_link spec Hangbin Liu
2024-03-08 13:05 ` Donald Hunter
2024-03-11 10:08   ` Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).