🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15030

[PATCH net-next v3 1/5] seg6: split final End process out of flavor processing

#15030
From: Hangbin Liu
Date: Thu, 12 Nov 2026 09:27
70 lines
10606 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.

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 f71e47b5e764..65d552f87fa3 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -885,6 +885,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)
 {
@@ -945,7 +948,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);
@@ -957,6 +960,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);
@@ -970,7 +974,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: <20261112-srv6_flavors_endx-v3-1-c9177bbbd965@kylinos.cn>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361644-linux-kernel-netdev=dewy.ru
References: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361644-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 1/5] seg6: split final End process out of
 flavor processing
Date: Thu, 12 Nov 2026 17:27:56 +0800
Organization: Usenet Network
Message-ID: <20261112-srv6_flavors_endx-v3-1-c9177bbbd965@kylinos.cn>
References: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1057862"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:oDC+b0uHBXH9fiKInjfyUPmIOWI= sha256:aAhRrSkTb43UcEFEIr94TXx99fez7lvQPWaq9AKtwuI=
	sha1:3zr57wiitHbQk4ixhm2VeSyCZjk= sha256:RK8+bKpUlzeJU5XRBLvN77FckDjdk3yrZescIloYBOE=
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 13DC81141AB; Thu, 12 Nov 2026 13:14:32 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] 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 dSwxOVWoNl9S;
	Thu, 12 Nov 2026 13:14:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-361644-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 00CD811418E; Thu, 12 Nov 2026 13:14:19 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id A8EFD1A6B63; Thu, 12 Nov 2026 09:28:58 +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=1794475720;
	b=3N2ttzMc5UgwmcSVpTM88FVkiJDTSTtsYscYE/4QmvOWmA7gwA+i41bOYtJvPuImLZFE
	 LzW9XOE9URKrg7L0DzlCJzgn1TnD6T/BLkEroCYLzXEUDhEG/57H9V820Et9gSmmJZBBM
	 Ua2e3eiPKiP1sSOEN1Z3WG0yI8ZD120ratScOjRom8AAHFG3QMrqAt0x4s9n8sYmRlS/w
	 /8FsC7RwFmayxHb2J5qjEnGC9o0OlSd6pHE2kD2YTDVgW9nBCUnsQLR9a/JCEMhWLoWoY
	 CPtEOeZCSz1+SUXCsTw7qBG+xg1DTH1Dp0MSkiDNSNPBIbFiD8KyzqGd0gm2XL1taEw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794475720;
	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=Oh7pEweTka3zkQsRuXJERHa5bAXzxW+yDE0QBxnaa64=;
	b=d+ujvAZxBvbD7uxdPQ0IfOCzYOG1kE3HFhPboh83U/86TUTlzAQFFn72Q0uQM/Kc0zRe
	 jV+eybd5kX1mgw0ABPYopi+JtgFLZUNB0C3G9iT4iD+Nl7nMtKRauz03fEOtGqnYdGsHM
	 CyA42n86Zv82XxK/sKJ9XjCslMJ5m4fXky6vPqoL5ow7td7Yus6Ohc8C4PkKOzdRyeSpE
	 sNKA7A1SBvkBbpV2/hk6lImCpfFVOJpdXePzcvbDSw8IpeGfFnL0SQteLB6lzgVu/0kHB
	 tC+zMKTU53icvvThRcbOfOebDk889V13kKISvFPTB6iNCrbsxt0VZkqjIbrRhY3i1ZA==
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=LsH37w4b;
	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 9C006606A889;
	Thu, 12 Nov 2026 09:28:40 +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=LsH37w4b
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.162
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794475719;
	b=WUUAFlbbuOxxl9Jvu313tD9PBJzI7ltxwf1HKtj9o6FcDTxLQso/RobhPEccVH9ddjX4
	 fIsZ+jziSQyr1WANdNyy0BqJV0Xu94bXY0ep2aUr27Tl6jApXULNzkHPs6LneRDcNa2W9
	 z5pa0NvULtkxyuJVivCt8D11S3WlO67DcdjdxtqfBgV82peol6hNm+ui3OvCC4NiXYwB6
	 fyL3ilnODjMoDrPouiED+UFyNTuOIHqx2r5O6JTlB+3bW8KDuowfzUVXzKhFSSpgZGeYW
	 FwGTwmzebhKhq+ES2mlwFq7rroc6GdEUdDVgsOCQBFatQ5DC2Ye3voEg3bntdDA19Ig==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794475719;
	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=Oh7pEweTka3zkQsRuXJERHa5bAXzxW+yDE0QBxnaa64=;
	b=KrVrUecZ8dwd49IMbEaqFVhUuxdk5ZnHfQ6WByPx4zl72WcoW8CnwbmR4msNgYX907F4
	 5MeCbya7zZGCIJIVkY3vQABHE73x52rsZpPs+sqiF3wJmVa8crQuhKAOlGP7wxn6TjSgA
	 G6uZKGWghSaSvYuaCSbh+5AOT5wfM7SDrI5GSwfTm0xeF1WCTuL/TjGGfCtP1mCF32MnL
	 q83Gh98lSLdQYZJykhzWEGdoeT2VcWy//dTbZZxgvneYqurJOlSmhMib5VxTeDrQuZA+i
	 GZ/abLcodx8viaek9o8JlOk5dzxiWWENEouGUuFzPV1C5s2xRtwVWRoniv4z8CT9efg==
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=LsH37w4b;
	arc=none smtp.remote-ip=95.215.58.162
X-Received: from mta1.migadu.com (out-162.mta1.migadu.com [95.215.58.162])
	(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 2697F606A32E
	for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 09:28:38 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2697F606A32E
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=7opVJAHK0m5GwSlc4qZV3y00qwxR2kUqAzycyzdxJUA=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794475717; v=1; x=1795080517;
 b=LsH37w4btILyvaCXtGlsdRrrbYGldAUJR601UJtjk54cN2+CXEBDrT0kw2kD/okGRY+J70It
 ZtDnszW1+kOW93jQJcI1Mt30x0V3GEkuq7fvDLIi7T89O7a3sC87Z53NSEgqD06ppPm9ZXE62S6
 wEGFRa8POXNFaIOU9YsBlCXs=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id ac79973681355c66;
	Thu, 12 Nov 2026 09:28:37 +0000
X-Mizu-Trace-ID: ac79973681355c66
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: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@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 <liuhangbin@kylinos.cn>
X-Mailer: b4 0.16.0