Article View: linux.kernel.netdev
Article #554[PATCH net-next v4 4/6] netlink: specs: rt-route: describe lwtunnel IP options
From: Hangbin Liu
Date: Thu, 08 Oct 2026 08:24
Date: Thu, 08 Oct 2026 08:24
98 lines
8320 bytes
8320 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>
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@kylinos.cn>
---
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
Technical Details
Message-ID:
<20261008-ynl_rt_encap-v4-4-4ed2ccf7f949@kylinos.cn>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342818-linux-kernel-netdev=dewy.ruReferences:
<20261008-ynl_rt_encap-v4-0-4ed2ccf7f949@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342818-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v4 4/6] netlink: specs: rt-route: describe lwtunnel IP options Date: Thu, 08 Oct 2026 16:24:04 +0800 Organization: Usenet Network Message-ID: <20261008-ynl_rt_encap-v4-4-4ed2ccf7f949@kylinos.cn> References: <20261008-ynl_rt_encap-v4-0-4ed2ccf7f949@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="835557"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:K0TwLkCpOoIqHY2oHEkBQCbJ40o= sha256:wXdKXlMUT2UYYXi9aeFBsA/MBqOjIyXv3BZPhiNFL90= sha1:YGG6kJ52B8qXUZm0JEqist3nuU0= sha256:W3dkV5917UUd5Dln3WZw8XUljYqzn2RUscxtq6gqo50= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 811E110F34D; Thu, 8 Oct 2026 11:26:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.85 X-Spam-Status: No, score=-0.85 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aw99RXygy6ro; Thu, 8 Oct 2026 11:26:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342818-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 2125C10F33D; Thu, 8 Oct 2026 11:26:46 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 9E321606043; Thu, 8 Oct 2026 08:24:51 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 003EF46E007; Thu, 8 Oct 2026 08:24:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="G/eKUEyw" X-Received: from mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAA4246D543 for <netdev@vger.kernel.org>; Thu, 8 Oct 2026 08:24:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791447880; cv=none; b=U1EUVn/ZBwOmLsdTpO/al3V5Ypx9YFOBmLTUPuhUbY335XSQ64Vh55qr1Mpgymi+fGdzx6Z/y3OsFnMcq6y/9tfrF9Gb98t1LN+bs+SEU6S3R4g/9ELH3i+r4oQ9122ZW3wWePKEBg96ACKuz4Gh3BcwCsQKDRzK7DLLJ7ZdPdU= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791447880; c=relaxed/simple; bh=NTRyTxRHG8F0/m6wgWwuN6NdB1Ih3Hf+reCm0hfOExo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XPpLCCCMgW1Jk+Wp9t8sewoykV/ALLH2G9lrtjDakBEVA6obhch3Om6N6QW+FoMg61dqSxIP4Dh1SrXIEYWUPD31J+r/4KB77GB+6oO8o6zSjNZ6zrLTlKIz1cVZ4BqfLS45O6ToVOOfpgh6X2X0yNP4LJtzk3VtpXQ8a5qf4kc= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=G/eKUEyw; arc=none smtp.client-ip=91.218.175.173 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=NTRyTxRHG8F0/m6wgWwuN6NdB1Ih3Hf+reCm0hfOExo=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1791447876; v=1; x=1792052676; b=G/eKUEyw9FprIJ4gpszTeYh6V3YxtEY6EOpb18BKuQnF7EWGRi8FcnHPU8dLS+Hm/kPdKHd8 gtEIiPWkUj4eIJffJ4gGnJVPxKK3GiRFPSoa0W2s2gwKFMmAu/VDdrTVHD3ajw5PR4rypAVLroj Dvb+7e9U5DWLwUpwmAL5LKf0= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id 3bc7d44c8e0f29c1; Thu, 08 Oct 2026 08:24:36 +0000 X-Mizu-Trace-ID: 3bc7d44c8e0f29c1 X-Migadu-Flow: FLOW_OUT X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261008-ynl_rt_encap-v4-0-4ed2ccf7f949@kylinos.cn> X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu <liuhangbin@kylinos.cn> X-Mailer: b4 0.14.3