Article View: linux.kernel.netdev
Article #1163[PATCH net-next v2 1/5] seg6: split final End process out of flavor processing
From: Hangbin Liu
Date: Fri, 09 Oct 2026 09:58
Date: Fri, 09 Oct 2026 09:58
70 lines
7951 bytes
7951 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
hard 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 0c3d1be7f129..4fcfcd48cfae 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -825,6 +825,9 @@ static bool seg6_pop_srh(struct sk_buff *skb, int srhoff)
/* 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)
{
@@ -882,7 +885,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);
@@ -894,6 +897,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);
@@ -907,7 +911,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.55.0
Technical Details
Message-ID:
<20261009-srv6_flavors_endx-v2-1-56ac7f838f41@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-343566-linux-kernel-netdev=dewy.ruReferences:
<20261009-srv6_flavors_endx-v2-0-56ac7f838f41@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-343566-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v2 1/5] seg6: split final End process out of flavor processing Date: Fri, 09 Oct 2026 17:58:37 +0800 Organization: Usenet Network Message-ID: <20261009-srv6_flavors_endx-v2-1-56ac7f838f41@kylinos.cn> References: <20261009-srv6_flavors_endx-v2-0-56ac7f838f41@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1078051"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7Ik7CteT7kV6PXg8IKcEGf18sj0= sha256:xjn00nO15Stg6nSZaLIRtHt/RmqTVOLQwNrDUIH+c+o= sha1:OHro1Fa5VTPISlqJQ5fbAg+S0l0= sha256:VXAU3RtbsQl9R0LjRZPLWrmvqACWcpYXd/xEzlM69lk= 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 D01D210F644; Fri, 9 Oct 2026 13:00:00 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.751 X-Spam-Status: No, score=-0.751 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, 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 q7rFEU1bSyzP; Fri, 9 Oct 2026 12:59:58 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343566-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 B359B10F0B0; Fri, 9 Oct 2026 12:59:54 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 47FC22F2F8; Fri, 9 Oct 2026 09:59:14 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAE2A4A43FF; Fri, 9 Oct 2026 09:59:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="W85xBscr" X-Received: from mta1.migadu.com (out-35.mta1.migadu.com [95.215.58.35]) (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 3FF7C49BD7C for <netdev@vger.kernel.org>; Fri, 9 Oct 2026 09:59:00 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.35 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539942; cv=none; b=TZKdw85k+mfsSMB7Z17hAAo5xMmkFT2Jb/cZ5FNRmlVNYQEt/RpbR9ySAF9Q9jly9+Cvokxm2Ppoqc7SIhfXIfKg9P60oF/TNWEsMSTd6K8s61b6UMquez9OULnOUk9LxWsseDuqndJv88l4FX0xhMUoZSKvX8IZum3bqfuJsIc= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791539942; c=relaxed/simple; bh=Y1uVmzV2bz3CYLlsqzMYFKGNCe5FlbP0nIN2N71tN0c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I19Wu+7mQtaxF5oqd7FtkQREVROjPVb8qQ0xnO1K8p0SSOKMXyOP1ENwL9fva0Xd8NOzTbABB4gEoG3BX9GNf6ZtRcdss+a+wXZu299ej0kjrlE6AbMFd6P/si8akdzFonM3bA8EzNKuGq1wjANmD9YHFgc79MC3LdJiSD9kbl4= 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=W85xBscr; arc=none smtp.client-ip=95.215.58.35 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=Y1uVmzV2bz3CYLlsqzMYFKGNCe5FlbP0nIN2N71tN0c=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1791539938; v=1; x=1792144738; b=W85xBscrD2OcZCBnBksT08TfuGb7PR0TKH9wtj/BYtyrnBHYRrFOyhk2KWPwW5T+mcF0ms4c fPHLR9S4isrNRlsgej9gf860QOy/5PJBjmaZPNHJUuLmVhq74XeBEuyRocAcAlekxDisdQJbkIi N+dS1HG1cm1+BiQNNKl88KQk= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id e08e76e40cb58c40; Fri, 09 Oct 2026 09:58:58 +0000 X-Mizu-Trace-ID: e08e76e40cb58c40 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: <20261009-srv6_flavors_endx-v2-0-56ac7f838f41@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.14.3