From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 9E05E400DF9 for ; Thu, 17 Sep 2026 06:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626972; cv=none; b=R7Ls9FMj/mLOhn1/PSKkOyLOU0HQ2hdpHMjywG4XwqI8PLBFb2jkVgCMpCGFsgFEqOogL+7FLDun/Mo6+iwxCuBvEHEaGSRgqfTrfihRYFJxlp4XI0N6BjVIynwJAQBPw7k+HqK/uconDP4Su9StdDjttVQehTrRC2DIsAZAxQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626972; c=relaxed/simple; bh=+TEUw+9bfsRkWHwf61os0Q82n+DPpaf+QTn7DrG2OyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B7DtyYAP/dRo+ToB5tEdhA8qVWvXV3qyQBPbQRB7ZsdiNyMO0R4P5C27Buf8u+JzMWQYMhxS1RXzhao7/f+88WHZlEoUPGca3a6DLFyEe/L4Oley3pouzElZPqb8VHcaTn6vUK0z5UO3eZQCV3NVrOLP2W5eyw2Xfe5SyMbU8HA= 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=vyawrA3F; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="vyawrA3F" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=+TEUw+9bfsRkWHwf61os0Q82n+DPpaf+QTn7DrG2OyE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626967; v=1; x=1790231767; b=vyawrA3Fpmfmy9CjRrpDLI7Tq92hFGpnom0UsijC23fTIQKtkg0iEKGFfuO6asQJPdS1eLUT N/9RsgLagcWDpu75XcYoRJ99pOYSyq/+NPeGIwhLc7CRN9gGPSzUwtONxU/BOLMbsNpbcnCuLHv wJUvFqjsZi7fai5OQCFGzOV4= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id d725fe4ac47aab61; Thu, 17 Sep 2026 06:36:07 +0000 X-Mizu-Trace-ID: d725fe4ac47aab61 X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:33 +0800 Subject: [PATCH net-next 1/6] net: lwtunnel: change encap fill order Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-1-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu When decoding sub=E2=80=91messages, YNL tries to fetch the "selector" (enca= p=E2=80=91type) first. However, lwtunnel fills encap=E2=80=91payload data first, which caus= es YNL to fail decoding the lwtunnel encap message. Fixing this inside YNL would be complex, so change the order in the kernel and emit encap_type first. Signed-off-by: Hangbin Liu --- net/core/lwtunnel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c index b01a395d9a96..f13dfa02e026 100644 --- a/net/core/lwtunnel.c +++ b/net/core/lwtunnel.c @@ -240,6 +240,10 @@ int lwtunnel_fill_encap(struct sk_buff *skb, struct lw= tunnel_state *lwtstate, lwtstate->type > LWTUNNEL_ENCAP_MAX) return 0; =20 + ret =3D nla_put_u16(skb, encap_type_attr, lwtstate->type); + if (ret) + return ret; + nest =3D nla_nest_start_noflag(skb, encap_attr); if (!nest) return -EMSGSIZE; @@ -254,9 +258,6 @@ int lwtunnel_fill_encap(struct sk_buff *skb, struct lwt= unnel_state *lwtstate, if (ret) goto nla_put_failure; nla_nest_end(skb, nest); - ret =3D nla_put_u16(skb, encap_type_attr, lwtstate->type); - if (ret) - goto nla_put_failure; =20 return 0; =20 --=20 2.55.0 From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-198.mta0.migadu.com [91.218.175.198]) (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 ED59B43990A for ; Thu, 17 Sep 2026 06:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626980; cv=none; b=ATEfdWwdFBY+Z3+786wvq/o3vHOLvpjfRIqUc4Xf9/QBSVU8PKnqdAlcP+u824c0nHz7WW7YltK5a3PAH3hoxxWCf+q/fEpM6TiATTu0BWx/NuCjBhh0jLASZruNErYIU8aY8USybQWsvpS4Xde1vcTehOVoqnpXhzfz63kX6IY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626980; c=relaxed/simple; bh=J4MLi0w09Di2aBki03cBZ/n1uOIgq0MonD+TEv4n5bE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U57H1Lu6mmy8qcZQfJYYFVCwe2sD5Mlc1Q3UPh71O7bTiuC4HtLAJ6sY5/JQfT0J/qMKV28I+27uzaFPQjJsCrfxUDNvAmRqJZBvrGyv4V1ckf77VeekA/PGxz9ZNw47O1/PjDM0JOf3dQHheUw3NvXt9tUIcEZv8R8JCU56IfI= 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=xvAwJoDy; arc=none smtp.client-ip=91.218.175.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xvAwJoDy" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=J4MLi0w09Di2aBki03cBZ/n1uOIgq0MonD+TEv4n5bE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626976; v=1; x=1790231776; b=xvAwJoDyoEbtNkUG7PyjwN1+Aq5XQ6AH7v1lDvBqR3uD35oOvVvCAzTDMiMw36PbTPHEMaCz HRtMHVvbb8AaR5ZW2qO7Xv2BEwugXcXrjzZKPbkCjtd693bPJ/1Zcj9keoK9JITt53EXPrcDIuO cEsnY2jOXblN341CGy3sV+MI= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 41156bba5621bac1; Thu, 17 Sep 2026 06:36:16 +0000 X-Mizu-Trace-ID: 41156bba5621bac1 X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:34 +0800 Subject: [PATCH net-next 2/6] tools: ynl: convert enum selector to string for sub-message parsing Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-2-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu YNL sub-message parsing expects a string selector for strcmp(). So for non-external enum selectors, convert the integer value to its string form via the family's {enum}_str() helper. This enables correct decoding of sub-messages keyed by enum values. Signed-off-by: Hangbin Liu --- tools/net/ynl/pyynl/ynl_gen_c.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen= _c.py index 2b3483db1b60..45bd7bc834b4 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -951,9 +951,17 @@ class TypeSubMessage(TypeNest): sel_var =3D f"_sel_{sel}" else: sel_var =3D f"{var}->{sel}" + + parse_sel =3D sel_var + if not self.selector.is_external() and self.selector.attr and \ + "enum" in self.selector.attr.attr: + enum_name =3D self.selector.attr.attr["enum"] + str_fn =3D c_lower(self.family.ident_name + "-" + enum_name) += "_str" + parse_sel =3D f"{str_fn}({sel_var})" + get_lines =3D [f'if (!{sel_var})', f'return ynl_submsg_failed(yarg, "{self.name}", "{sel= ector}");', - f"if ({self.nested_render_name}_parse(&parg, {sel_var= }, attr))", + f"if ({self.nested_render_name}_parse(&parg, {parse_s= el}, attr))", "return YNL_PARSE_CB_ERROR;"] init_lines =3D [f"parg.rsp_policy =3D &{self.nested_render_name}_n= est;", f"parg.data =3D &{var}->{self.c_name};"] --=20 2.55.0 From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-209.mta0.migadu.com [91.218.175.209]) (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 4735F44239F for ; Thu, 17 Sep 2026 06:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626987; cv=none; b=pYcFn75X/5ZgvzJJVIoHyI1JcnB+dnh6qrnn7S1aYJI3ZvQAN1s3KQJAIjSn6CWEWpaOBkZ8vXzvZf8YH39Lomat02GwTofnbGZdf42PMQgf6zN9t+el5NTGgdVqYH9dDAJbVDHBCbKWFCdNQ2g+Jyf+jH2ck5XN9uy+r2qBViw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626987; c=relaxed/simple; bh=CKqhhcu0rmL4j9sA8S+uFD+vyWjumVn50IKBciwByDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dLXMMdPZ1W0SrQFOVi5Yu2phhYRV9u9CaHKOz2dvwKaIN6ZoI3M4DyA/FhVjSMhvT1o0NIN8bgYwkzfrQTV7M6aA6g9DiBv9X2EXSbkdqBCVRS1VHVPvxlGaflbElgF3/1lT+4nfOE2LTl63wFwsuD3XVUbDpXkD5ZUNJpqDWnw= 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=uhxByXgw; arc=none smtp.client-ip=91.218.175.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uhxByXgw" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=CKqhhcu0rmL4j9sA8S+uFD+vyWjumVn50IKBciwByDA=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626982; v=1; x=1790231782; b=uhxByXgwLfE/iW3jfAg6zd2Tr4XT2vOpOU4jRauaXXm4ksugYBA77Z/yZEvDIV9a7cIRrf8S nZj+zK2M9CGLRmxxABS36/G+pcVweBkAZ5PSPq7oyv3CsHwYEESn+34Jg+iVrFoV4qn551ygoLZ mI0L2AlXKI1d0PchzY0uN4zU= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 8596e500ab7640cc; Thu, 17 Sep 2026 06:36:22 +0000 X-Mizu-Trace-ID: 8596e500ab7640cc X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:35 +0800 Subject: [PATCH net-next 3/6] netlink: specs: rt-route: add lwtunnel encap sub-message support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-3-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu Define encap-type enum (LWTUNNEL_ENCAP_*) and add encap-data sub-message keyed by encap-type. Add tunnel attribute sets (mpls, ila, seg6, rpl, ioam6, xfrm) and IP/IP6 tunnel sets. Keep some nested option attributes as binary in this patch to simplify review; they will be converted in follow-up patches. Also add the Makefile to include uapi headers. Note the lwtunnel.h is guarded by _UAPI_LWTUNNEL_H_. Signed-off-by: Hangbin Liu --- Documentation/netlink/specs/rt-route.yaml | 280 ++++++++++++++++++++++++++= +++- tools/net/ynl/Makefile.deps | 9 +- 2 files changed, 287 insertions(+), 2 deletions(-) diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netl= ink/specs/rt-route.yaml index 253037ea5176..0e236da140dc 100644 --- a/Documentation/netlink/specs/rt-route.yaml +++ b/Documentation/netlink/specs/rt-route.yaml @@ -99,6 +99,58 @@ definitions: name: ra-withdrawn doc: A Router Advertisement withdrew the route with a zero lifetime. + - + name: encap-type + type: enum + name-prefix: lwtunnel-encap- + enum-name: + entries: + - none + - mpls + - ip + - ila + - ip6 + - seg6 + - bpf + - seg6-local + - rpl + - ioam6 + - xfrm + +sub-messages: + - + name: encap-data + formats: + - + value: mpls + attribute-set: mpls-iptunnel + - + value: ip + attribute-set: lwtunnel-ip + - + value: ila + attribute-set: ila-attrs + - + value: ip6 + attribute-set: lwtunnel-ip6 + - + value: seg6 + attribute-set: seg6-iptunnel + - + value: bpf + attribute-set: lwt-bpf + - + value: seg6-local + attribute-set: seg6-local + - + value: rpl + attribute-set: rpl-iptunnel + - + value: ioam6 + attribute-set: ioam6-iptunnel + - + value: xfrm + attribute-set: lwt-xfrm =20 attribute-sets: - @@ -174,9 +226,12 @@ attribute-sets: - name: encap-type type: u16 + enum: encap-type - name: encap - type: binary # tunnel specific nest + type: sub-message + sub-message: encap-data + selector: encap-type - name: expires type: u32 @@ -277,6 +332,229 @@ attribute-sets: - name: fastopen-no-cookie type: u32 + - + name: mpls-iptunnel + name-prefix: mpls-iptunnel- + header: linux/mpls_iptunnel.h + attributes: + - + name: dst + type: binary + - + name: ttl + type: u8 + - + name: lwtunnel-ip + name-prefix: lwtunnel-ip- + header: linux/lwtunnel.h + attributes: + - + name: id + type: u64 + - + name: dst + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: src + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: ttl + type: u8 + - + name: tos + type: u8 + - + name: flags + type: u16 + - + name: pad + type: pad + - + name: opts + type: binary # lwtunnel ip nest options + - + name: ila-attrs + name-prefix: ila-attr- + header: linux/ila.h + attributes: + - + name: locator + type: u64 + - + name: identifier + type: u64 + - + name: locator-match + type: u64 + - + name: ifindex + type: s32 + - + name: dir + type: u32 + - + name: pad + type: pad + - + name: csum-mode + type: u8 + - + name: ident-type + type: u8 + - + name: hook-type + type: u8 + - + name: lwtunnel-ip6 + name-prefix: lwtunnel-ip6- + header: linux/lwtunnel.h + attributes: + - + name: id + type: u64 + - + name: dst + type: binary + display-hint: ipv6 + - + name: src + type: binary + display-hint: ipv6 + - + name: hoplimit + type: u8 + - + name: tc + type: u8 + - + name: flags + type: u16 + - + name: pad + type: pad + - + name: opts + type: binary # lwtunnel ip nest options + - + name: seg6-iptunnel + name-prefix: seg6-iptunnel- + header: linux/seg6_iptunnel.h + attributes: + - + name: srh + type: binary + - + name: src + type: binary + display-hint: ipv6 + - + name: table + type: u32 + - + name: lwt-bpf + name-prefix: lwt-bpf- + header: linux/lwtunnel.h + attributes: + - + name: in + type: binary # bpf prog + - + name: out + type: binary + - + name: xmit + type: binary + - + name: xmit-headroom + type: u32 + - + name: seg6-local + name-prefix: seg6-local- + header: linux/seg6_local.h + attributes: + - + name: action + type: u32 + - + name: srh + type: binary + - + name: table + type: u32 + - + name: nh4 + type: u32 + display-hint: ipv4 + - + name: nh6 + type: binary + display-hint: ipv6 + - + name: iif + type: u32 + - + name: oif + type: u32 + - + name: bpf + type: binary + - + name: vrftable + type: u32 + - + name: counters + type: binary + - + name: flavors + type: binary + - + name: rpl-iptunnel + name-prefix: rpl-iptunnel- + header: linux/rpl_iptunnel.h + attributes: + - + name: srh + type: binary + - + name: ioam6-iptunnel + name-prefix: ioam6-iptunnel- + header: linux/ioam6_iptunnel.h + attributes: + - + name: mode + type: u8 + - + name: dst + type: binary + display-hint: ipv6 + - + name: trace + type: binary + - + name: freq-k + type: u32 + - + name: freq-n + type: u32 + - + name: src + type: binary + display-hint: ipv6 + - + name: lwt-xfrm + name-prefix: lwt-xfrm- + header: linux/lwtunnel.h + attributes: + - + name: if-id + type: u32 + - + name: link + type: u32 =20 operations: enum-model: directional diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps index 2771375339d9..b35639cb26f5 100644 --- a/tools/net/ynl/Makefile.deps +++ b/tools/net/ynl/Makefile.deps @@ -44,7 +44,14 @@ CFLAGS_rt-link:=3D$(call get_hdr_inc,__LINUX_RTNETLINK_H= ,rtnetlink.h) \ $(call get_hdr_inc,_LINUX_IF_LINK_H,if_link.h) CFLAGS_rt-neigh:=3D$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ $(call get_hdr_inc,__LINUX_NEIGHBOUR_H,neighbour.h) -CFLAGS_rt-route:=3D$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) +CFLAGS_rt-route:=3D$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ + $(call get_hdr_inc,_LINUX_IOAM6_IPTUNNEL_H,ioam6_iptunnel.h) \ + $(call get_hdr_inc,_LINUX_MPLS_IPTUNNEL_H,mpls_iptunnel.h) \ + $(call get_hdr_inc,_LINUX_SEG6_IPTUNNEL_H,seg6_iptunnel.h) \ + $(call get_hdr_inc,_LINUX_RPL_IPTUNNEL_H,rpl_iptunnel.h) \ + $(call get_hdr_inc,_LINUX_SEG6_LOCAL_H,seg6_local.h) \ + $(call get_hdr_inc,_LWTUNNEL_H_,lwtunnel.h) \ + $(call get_hdr_inc,_LINUX_ILA_H,ila.h) CFLAGS_rt-rule:=3D$(call get_hdr_inc,__LINUX_FIB_RULES_H,fib_rules.h) CFLAGS_tc:=3D $(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ $(call get_hdr_inc,__LINUX_PKT_SCHED_H,pkt_sched.h) \ --=20 2.55.0 From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-226.mta0.migadu.com [91.218.175.226]) (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 59991443E2E for ; Thu, 17 Sep 2026 06:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626992; cv=none; b=BGq0lpmtZhaNMgfaVS+xTTtQuAkZhUw1o03fKT1py0UqHXrLep5az+MilWfhmjqlx0ORKnjdVgzv1h7P7qM/SO4Vah1GwiSAN/NDK6iUvMiYU5P23s3xhHJmXPhKvLLfawG0uvsuORcSc5Aaos/LwTlvRLWfrqfphIOHXbyB3to= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626992; c=relaxed/simple; bh=J+NNm1pkPjP+txuYq6Ee+FpmL9x8Jg1gXQIPtzOYHxc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PrK/VIMokZyiwZEEQKzrorKLtrj5RT/uVHy/GbB9W5OpuSPc2uqy61Ixk0W1/QM5b8+sk9UlBs6d3416GQdiyERZfrQDxCFn7wygIqia/cJby33mzzZZpQxUo/rZfDerp7t/d29+sF24+zI+45pygO3YIk+xyg9NMQVCegkothQ= 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=bVen5T5M; arc=none smtp.client-ip=91.218.175.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bVen5T5M" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=J+NNm1pkPjP+txuYq6Ee+FpmL9x8Jg1gXQIPtzOYHxc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626988; v=1; x=1790231788; b=bVen5T5MwhNIE70pH/09dG4zg43UDb9xB07jTj7maPv8TgDIQtBv4sMGLwFCxdK2kHOHNJyl 3klXUh9g2P21CyI1SsrizHHnmo+J81EqUQj/ExNnXxkQ+OaNPZFQONxhdXDpeMpow85wHOrJUu+ d+dc5loMpqzurv0tiGyd6AOs= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 9b6067e378413a3e; Thu, 17 Sep 2026 06:36:28 +0000 X-Mizu-Trace-ID: 9b6067e378413a3e X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:36 +0800 Subject: [PATCH net-next 4/6] netlink: specs: rt-route: describe lwtunnel IP options Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-4-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu 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. Signed-off-by: Hangbin Liu --- Documentation/netlink/specs/rt-route.yaml | 59 +++++++++++++++++++++++++++= ++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netl= ink/specs/rt-route.yaml index 0e236da140dc..6030d7cb8d0d 100644 --- a/Documentation/netlink/specs/rt-route.yaml +++ b/Documentation/netlink/specs/rt-route.yaml @@ -375,7 +375,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- @@ -438,7 +439,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- @@ -555,6 +557,59 @@ attribute-sets: - name: link type: u32 + - + name: lwtunnel-ip-opts + name-prefix: lwtunnel-ip-opts- + attributes: + - + name: geneve + type: nest + nested-attributes: lwtunnel-ip-opt-geneve + - + name: vxlan + type: nest + nested-attributes: lwtunnel-ip-opt-vxlan + - + name: erspan + type: nest + nested-attributes: lwtunnel-ip-opt-erspan + - + name: lwtunnel-ip-opt-geneve + name-prefix: lwtunnel-ip-opt-geneve- + attributes: + - + name: class + type: u16 + byte-order: big-endian + - + name: type + type: u8 + - + name: data + type: binary + - + 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 + - + name: dir + type: u8 + - + name: hwid + type: u8 =20 operations: enum-model: directional --=20 2.55.0 From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-241.mta0.migadu.com [91.218.175.241]) (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 D8E803A75BB for ; Thu, 17 Sep 2026 06:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.241 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626997; cv=none; b=gaGHaQtr66gvenkc9mnRFXaA6nr09tO6edwfO/ndRx4pMyI5MZvYuBuQDOlG9pjjXb1E0VAWHh0TN2R3wzHsgDZrh2tu08iIszMe2Jn4ucwa1nfwD7vHf7upi9zQqZV2ajtvp8VwTYofvmoJvsK9jFS8kFjdjhIUscR4JKrsIdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789626997; c=relaxed/simple; bh=aikSuubhuRBRklJlpWq3zTZA6ZWmLVtU9b81OoFlDPE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TBDA3vSa2RDXpOGTfxd08bzMyP8p887taGTKELLIDMItIpTDrNuGpeI8k8LXFV06ICWnSRhoIbotLa9FEO96ZIMcAoqTg3OP6ixKIPRnJVKznQJsJ0FWi70i80kw7eFOZMcASMGXoyqZV/R9DzUSAN7gsQFlemIegcK93rGG8lA= 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=KkFZ6s+x; arc=none smtp.client-ip=91.218.175.241 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KkFZ6s+x" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=aikSuubhuRBRklJlpWq3zTZA6ZWmLVtU9b81OoFlDPE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626993; v=1; x=1790231793; b=KkFZ6s+xsJZpcGHDfhbVqjstzMaqF1Kcf9AnmCqm6ueEWktV/Dv448pjzbpAPU2S1f67vfYZ OQxxYXT8TDZHquUIzdOWE0rCNqsXuVdP1w3RY107b4c85lyRQsXTwXihR88EPu/HggLL4BadAhq YGNei0oLcl3X94yQJIUaJLMM= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 98acb50523c55b4f; Thu, 17 Sep 2026 06:36:33 +0000 X-Mizu-Trace-ID: 98acb50523c55b4f X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:37 +0800 Subject: [PATCH net-next 5/6] netlink: specs: rt-route: describe lwt BPF program options Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-5-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu Replace binary BPF attributes with a nested lwt-bpf-prog to support lwt bpf prog options. Signed-off-by: Hangbin Liu --- Documentation/netlink/specs/rt-route.yaml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netl= ink/specs/rt-route.yaml index 6030d7cb8d0d..5e9537f7dfad 100644 --- a/Documentation/netlink/specs/rt-route.yaml +++ b/Documentation/netlink/specs/rt-route.yaml @@ -463,13 +463,16 @@ attribute-sets: attributes: - name: in - type: binary # bpf prog + type: nest + nested-attributes: lwt-bpf-prog - name: out - type: binary + type: nest + nested-attributes: lwt-bpf-prog - name: xmit - type: binary + type: nest + nested-attributes: lwt-bpf-prog - name: xmit-headroom type: u32 @@ -503,7 +506,8 @@ attribute-sets: type: u32 - name: bpf - type: binary + type: nest + nested-attributes: lwt-bpf-prog - name: vrftable type: u32 @@ -610,6 +614,16 @@ attribute-sets: - name: hwid type: u8 + - + name: lwt-bpf-prog + name-prefix: lwt-bpf-prog- + attributes: + - + name: fd + type: u32 + - + name: name + type: string =20 operations: enum-model: directional --=20 2.55.0 From nobody Fri Sep 25 03:21:20 2026 Received: from mta0.migadu.com (out-2.mta0.migadu.com [91.218.175.2]) (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 B46563AF64D for ; Thu, 17 Sep 2026 06:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789627003; cv=none; b=sBXz5KH2WYNJXdzyRR7AvIKsShjEukrjJWMsX8ohQUR1+N4q2GY98MQ4C5sYSLcQp2+9o+Djou95VcA31/8+in0d0eoDVIv0hTApimBFDVChpMqLMW426EEv2BfWyeawF+2SC7QrHakfnL3pvkR8OyXLr5Y2q6HpJirrFddIC08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789627003; c=relaxed/simple; bh=y8Py39i/yspq4Bso5dXje7reSwruHUJQYifLxun11GQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S7s0CJ5bdwVorzWQwlbUpU+wIvKJjO3dWEwpzvijploKHks3sdvmvhnaEPTCsELVEb8yzUVc3F9iCpM6YRwZHR1LS6ibWj2wUiYD3L6j7HSEFBGjmGqe/T8e3Lhm6mnlYTi0MgBgBIB9jp1dhsgE4diglHEz8W20dAD7uUSh6ks= 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=vNXHikoU; arc=none smtp.client-ip=91.218.175.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="vNXHikoU" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=y8Py39i/yspq4Bso5dXje7reSwruHUJQYifLxun11GQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789626999; v=1; x=1790231799; b=vNXHikoUs59cXg3H+P9igpBX77GGodxCy1+kCvjuwgUwoD8kq4UlrCq3wERqkBgFxpMEFCJv LgW2dzAeUFR1cKbpCrQjDVMosbGHcaN689u8Gu2Y5xAqgm5/exEn6HhQWNC5zAem7sWW/ifhMLE Ak1AMt3COUGwgGyV2I3MEKlk= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 79b33898e2639a0c; Thu, 17 Sep 2026 06:36:39 +0000 X-Mizu-Trace-ID: 79b33898e2639a0c X-Migadu-Flow: FLOW_OUT From: Hangbin Liu Date: Thu, 17 Sep 2026 14:35:38 +0800 Subject: [PATCH net-next 6/6] netlink: specs: rt-route: describe seg6-local actions, counters and flavors Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260917-ynl_rt_encap-v1-6-fbbe6e680571@kylinos.cn> References: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> In-Reply-To: <20260917-ynl_rt_encap-v1-0-fbbe6e680571@kylinos.cn> To: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter Cc: Hangbin Liu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu X-Mailer: b4 0.14.3 From: Hangbin Liu Add SEG6 local actions enum. Replace binary counters/flavors in seg6-local with nested seg6-local-cnt and seg6-local-flv. Signed-off-by: Hangbin Liu --- Documentation/netlink/specs/rt-route.yaml | 59 +++++++++++++++++++++++++++= ++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Documentation/netlink/specs/rt-route.yaml b/Documentation/netl= ink/specs/rt-route.yaml index 5e9537f7dfad..3929a877aa27 100644 --- a/Documentation/netlink/specs/rt-route.yaml +++ b/Documentation/netlink/specs/rt-route.yaml @@ -116,6 +116,29 @@ definitions: - rpl - ioam6 - xfrm + - + name: seg6-local-actions + type: enum + name-prefix: seg6-local-action- + enum-name: + entries: + - unspec + - end + - end-x + - end-t + - end-dx2 + - end-dx6 + - end-dx4 + - end-dt6 + - end-dt4 + - end-b6 + - end-b6-encap + - end-bm + - end-s + - end-as + - end-am + - end-bpf + - end-dt46 =20 sub-messages: - @@ -484,6 +507,7 @@ attribute-sets: - name: action type: u32 + enum: seg6-local-actions - name: srh type: binary @@ -513,10 +537,12 @@ attribute-sets: type: u32 - name: counters - type: binary + type: nest + nested-attributes: seg6-local-cnt - name: flavors - type: binary + type: nest + nested-attributes: seg6-local-flv - name: rpl-iptunnel name-prefix: rpl-iptunnel- @@ -624,6 +650,35 @@ attribute-sets: - name: name type: string + - + name: seg6-local-cnt + name-prefix: seg6-local-cnt- + attributes: + - + name: pad + type: pad + - + name: packets + type: u64 + - + name: bytes + type: u64 + - + name: errors + type: u64 + - + name: seg6-local-flv + name-prefix: seg6-local-flv- + attributes: + - + name: operation + type: u32 + - + name: lcblock-bits + type: u8 + - + name: lcnode-fn-bits + type: u8 =20 operations: enum-model: directional --=20 2.55.0