[PATCH net-next v4 4/6] netlink: specs: rt-route: describe lwtunnel IP options
From: Hangbin Liu
Date: Thu Oct 08 2026 - 04:30:17 EST
From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
Replace binary opts in lwtunnel-ip and lwtunnel-ip6 with a nested
lwtunnel-ip-opts set. Add attribute sets for geneve, vxlan, and erspan
IP options to match linux/lwtunnel.h.
Note the kernel encodes LWTUNNEL_IP_OPTS_GENEVE differently for requests
vs dumps. On the request path, the kernel iterates and reads one
CLASS/TYPE/DATA triplet per geneve option. On the dump path, the kernel
opens only one nested geneve option and writes a CLASS/TYPE/DATA triplet
for every option within it. Before there is a proper way to handle it,
I will just omit geneve options and use binary for it.
Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxxx>
---
For sashiko:
We don't need to add linux/lwtunnel.h for lwtunnel-ip-opts,
lwtunnel-ip-opt-vxlan and lwtunnel-ip-opt-erspan since the parent
one lwtunnel-ip already include it.
---
Documentation/netlink/specs/rt-route.yaml | 45 +++++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netlink/specs/rt-route.yaml
index dc842a786794..ea6711292c9b 100644
--- a/Documentation/netlink/specs/rt-route.yaml
+++ b/Documentation/netlink/specs/rt-route.yaml
@@ -377,7 +377,8 @@ attribute-sets:
type: pad
-
name: opts
- type: binary # lwtunnel ip nest options
+ type: nest
+ nested-attributes: lwtunnel-ip-opts
-
name: ila-attrs
name-prefix: ila-attr-
@@ -444,7 +445,8 @@ attribute-sets:
type: pad
-
name: opts
- type: binary # lwtunnel ip nest options
+ type: nest
+ nested-attributes: lwtunnel-ip-opts
-
name: seg6-iptunnel
name-prefix: seg6-iptunnel-
@@ -562,6 +564,45 @@ attribute-sets:
-
name: link
type: u32
+ -
+ name: lwtunnel-ip-opts
+ name-prefix: lwtunnel-ip-opts-
+ attributes:
+ -
+ name: geneve
+ type: binary
+ -
+ name: vxlan
+ type: nest
+ nested-attributes: lwtunnel-ip-opt-vxlan
+ -
+ name: erspan
+ type: nest
+ nested-attributes: lwtunnel-ip-opt-erspan
+ -
+ name: lwtunnel-ip-opt-vxlan
+ name-prefix: lwtunnel-ip-opt-vxlan-
+ attributes:
+ -
+ name: gbp
+ type: u32
+ -
+ name: lwtunnel-ip-opt-erspan
+ name-prefix: lwtunnel-ip-opt-erspan-
+ attributes:
+ -
+ name: ver
+ type: u8
+ -
+ name: index
+ type: u32
+ byte-order: big-endian
+ -
+ name: dir
+ type: u8
+ -
+ name: hwid
+ type: u8
operations:
enum-model: directional
--
2.55.0