Article View: linux.kernel.netdev
Article #25669[PATCH net-next v6 1/6] seg6: split final End process out of flavor processing
From: Hangbin Liu
Date: Wed, 02 Dec 2026 08:46
Date: Wed, 02 Dec 2026 08:46
71 lines
10758 bytes
10758 bytes
From: Hangbin Liu <liuhangbin@kylinos.cn>
Move the final End forwarding step out of end_flv8986_core() and return
success to the caller instead.
Currently end_flv8986_core() performs both RFC8986 flavor processing and
final End forwarding by calling input_action_end_finish(). That couples
flavor handling with the End-specific forwarding path, which makes it
unable to reuse the same flavor logic for other End variants.
Split the two steps so input_action_end() does:
1) end_flv8986_core() for flavor processing
2) input_action_end_finish() for final forwarding
This keeps end_flv8986_core() focused on RFC8986/PSP flavor semantics
and makes it easier to plug the same flavor core into End.X/T later.
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
net/ipv6/seg6_local.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index cd93b72a0b22..fc651a83e4b7 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -940,6 +940,9 @@ static struct ipv6_sr_hdr *seg6_flv8986_get_srh(struct sk_buff *skb)
/* process the packet on the basis of the RFC8986 flavors set for the given
* SRv6 End behavior instance.
+ *
+ * Returns with skb freed on failure. On success, the caller must complete
+ * final processing and forward the packet.
*/
static int end_flv8986_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
{
@@ -1000,7 +1003,7 @@ static int end_flv8986_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
goto drop;
}
- return input_action_end_finish(skb, slwt);
+ return 0;
drop:
kfree_skb_reason(skb, reason);
@@ -1012,6 +1015,7 @@ static int input_action_end(struct sk_buff *skb, struct seg6_local_lwt *slwt)
{
const struct seg6_flavors_info *finfo = &slwt->flv_info;
__u32 fops = finfo->flv_ops;
+ int ret;
if (!fops)
return input_action_end_core(skb, slwt);
@@ -1025,7 +1029,11 @@ static int input_action_end(struct sk_buff *skb, struct seg6_local_lwt *slwt)
* information extracted from the packet, e.g. presence/absence of SRH,
* Segment Left = 0, etc.
*/
- return end_flv8986_core(skb, slwt);
+ ret = end_flv8986_core(skb, slwt);
+ if (ret)
+ return ret;
+
+ return input_action_end_finish(skb, slwt);
}
/* regular endpoint, and forward to specified nexthop */
--
2.56.0
Technical Details
Message-ID:
<20261202-srv6_flavors_endx-v6-1-4e50b828e702@kylinos.cn>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375644-linux-kernel-netdev=dewy.ruReferences:
<20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375644-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v6 1/6] seg6: split final End process out of flavor processing Date: Wed, 02 Dec 2026 16:46:27 +0800 Organization: Usenet Network Message-ID: <20261202-srv6_flavors_endx-v6-1-4e50b828e702@kylinos.cn> References: <20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1926291"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7KCo5zTxJtLZp1jRZgn4vn/1V2M= sha256:2tWRw92y+07d0QGNzDljyCoZdweJn7VV0ZmQjFS1l4s= sha1:8V8Ty4XJ8BR5PK/vD3o7aoNHapw= sha256:cS00KXWYspxS1YXUDby+5PB56/PSLF3XgQovEEO8lNo= 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 11B341175B1; Wed, 2 Dec 2026 11:47:26 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, 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 i_wmIb5ZEbnK; Wed, 2 Dec 2026 11:47:22 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375644-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id BAC7111757C; Wed, 2 Dec 2026 11:47:13 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 774562C210; Wed, 2 Dec 2026 08:47:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796201228; b=OA69+bXE4PZYBNqVyigWyuJQhfT8eT6SNRbpKdcOwjIapQgOEicLR8Q4DOcBVUWTSd6p E/rXWtZ6a/1b43bFkgpBVY9DToOvwbvPsS/f2qWOjYK2T3N9kDTltZ7tKv2Hy9oeeJSaz JM8mPIxkRLnh1uj8UDigwSsO0SmGl6ziW5jTZ1bEM/M8qjAxBq5omT/qRwo9xLBCoPeSV RuP0jOA3ZTMORGd9fkrcmgB2Wcha9STboWK5x9hgLZdcSy1Z+JKxb7NYEPgM7p9bGr58R EEOgddnbNfEs2ok593wdK32W7NMWZU3e/QbGs3S7O5OetPKyZT1j/zV5VWdfnH2DoWg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796201228; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer; bh=XykY06JKK1FKLOcekh/zZjCbAVrZfUU28p9dYL7gGcs=; b=DSdpqy1bVO/UYVkj/YL4rLmQZcNyeP3bP3dThHwbMuaEJ67sJxHM3qTRsuT1LfL03m6s oayd7sM/j2wkeCudJPMMISOdg5YipPKQxjzt+VzXB+JWk3uubRSzBdbqV98YlNi4c8ReH JzEK2FcJHvao2rHr0ZBQ9v68btMi4St/JcT3VK8r78v2w25YN+4qzNm4LKGWv1kLOGpUh aRR3B0Fw129MDLgMkH3cVeSbFzCyaty/+6WALTW45cUmJimwMv3Nq0CpD/r+dPplORfqS xaBsNoolJall51URvLjsTXCdB/UCzIgK52QzFkCDjFCAbvT8BDwieeIJTNtAqIgyr2A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=hwKUxeVD; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80B05606A33B; Wed, 2 Dec 2026 08:47:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=hwKUxeVD X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.235 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796201222; b=od5CN2K7KuSkadUUsy9sNwB+EWLZ9vHlEe23tPG5PtJmtggnWJ/31ECcwAzSI65l6U+v /0c3mkSx5F49Hoc4dFqdIzIygzaP3m4kOC1xrg8GUK0U7KideHLcFyb2nRXSqbRHi4YJr I+XIR0hxbFm4FTvenxmLDMVJCQ96roqDA64ZZic5OXPqwoxpsxcoOuQZG/2fD796ljJ/v TnH5hI6gL/O+6w2bhOxhV74oNNriZI3q9DCjU9H9l85cDnApIPQL+OrhDiseW+U5O9g47 rlIugHs5fTpv8SeaJKl+vAPzJhzYj0y35Bv2iHtTuJODbXvhp0oDC3L2xCMs+Q2gJsw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796201222; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer; bh=XykY06JKK1FKLOcekh/zZjCbAVrZfUU28p9dYL7gGcs=; b=exhtaFgV5WeYBH81tR6k7T3srcRyaQIt2t68o7N13Fhg0PrYs65QoGs71XwVFJI0QflZ TzyadwkKoFTZQb5Engk/yLtD0vPKLMw1fLGv143BtzTGkr/o5NalaAU/jHF1hz/I+WSSz v+aAqJ+QhF/bHeFV51Iimh5ywDa6hC/vdii1IJ+7Ti+vVdk65TgUs4cg1rCHVHDXIYY4X 0wGPREhbASREaZKWKL78pOphM5yNx4oZf+G4UQe2HhZVXzpcY4rIbmOY1KGgDKCmMlZua 1EDwitwvqryEoD5AWesT/1Hvnug8R5CmhuIXaf70Du6UHMfjJ7Ix7h/LcxRIE/lL5NA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=hwKUxeVD; arc=none smtp.remote-ip=91.218.175.235 X-Received: from mta0.migadu.com (out-235.mta0.migadu.com [91.218.175.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EFA6606A689 for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 08:47:00 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6EFA6606A689 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=6ELxiAYEUamKrapBQ1KTU0vHrww9jCIOeSkpefy/KCA=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796201218; v=1; x=1796806018; b=hwKUxeVDVpT9e3dnuFeDHduH/Zf+6ZeNrGZ8TbBgDn9ky6qGWQ/YOpvpSJRx07d2f0sw1P+j XSkNntXIU+wzpH8NAcwur0oCV/HGwqSusE2ACgi7no0Sz/eF71LroeXiZfkx+I/Pn5lJuL1n1HN 78SSyz4AWUn815SQbHSD2q3Q= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 2f6890a69b724348; Wed, 02 Dec 2026 08:46:58 +0000 X-Mizu-Trace-ID: 2f6890a69b724348 X-Migadu-Flow: FLOW_OUT X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261202-srv6_flavors_endx-v6-0-4e50b828e702@kylinos.cn> X-Cc: Hangbin Liu <hangbin.liu@linux.dev>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Hangbin Liu <hangbin.liu@linux.dev> X-Mailer: b4 0.16.0