From e32b5eb4f237a5ddcf936c53e9ca387bb4cdd31c Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Thu, 8 Oct 2026 16:24:04 +0800 Subject: [PATCH] netlink: specs: rt-route: describe lwtunnel IP options 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 Link: https://patch.msgid.link/20261008-ynl_rt_encap-v4-4-4ed2ccf7f949@kylinos.cn Signed-off-by: Jakub Kicinski --- 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