Article View: linux.kernel.netdev
Article #19176[PATCH net-next v4 1/5] seg6: split final End process out of flavor processing
From: Hangbin Liu
Date: Thu, 19 Nov 2026 13:55
Date: Thu, 19 Nov 2026 13:55
70 lines
10657 bytes
10657 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:
<20261119-srv6_flavors_endx-v4-1-284cdb484eee@kylinos.cn>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367049-linux-kernel-netdev=dewy.ruReferences:
<20261119-srv6_flavors_endx-v4-0-284cdb484eee@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367049-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v4 1/5] seg6: split final End process out of flavor processing Date: Thu, 19 Nov 2026 21:55:17 +0800 Organization: Usenet Network Message-ID: <20261119-srv6_flavors_endx-v4-1-284cdb484eee@kylinos.cn> References: <20261119-srv6_flavors_endx-v4-0-284cdb484eee@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2886607"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6aEb/Ftnw0pKBLNEtm42JBB9XWo= sha256:fpzLZhIgTLANyUqDdrqbclDbT4uVQ4qP1S5n6OKMUOQ= sha1:aYFfB6siUJwyjVlyaQTXthxYP4I= sha256:IxB4NIAJ3p9gPPQfJErcJ13nf/oQyhe6zkfkERfwH2o= 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 1066611567D; Thu, 19 Nov 2026 16:56:25 +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 AIDMcIgiqHe7; Thu, 19 Nov 2026 16:56:20 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367049-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 0AC5E115679; Thu, 19 Nov 2026 16:56:11 +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 54C7B3007CB; Thu, 19 Nov 2026 13:55: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=1795096558; b=qFNl36jX+06J8XzZ6X7wBDrPP++IQJnan14D72hVmoPV98xQvEIGuAjagkwKbzqZrsGS CV6UOybKbH/LUfvRq0hWm8C3amN6icfofAeJfvUhR7ZtrUC3SAEI7lwiqM5DeK0f95e6O gdvr3LlaSj8xxFIzCR4dQGZM0YevwDF7TXHgeBn1b00c8g/HSn4iajd0taJzTA5zeXt25 589Bcg/CrKMpasaDTx6zTKkiF3Acjldc7slxVjfPweTUznqKdEgPlczcrJLX4WnHfmBFj mxjG1Q5U8kotPvelzw9QHYlp7T2JUN2dGw+Fh5Is/ZtIXVzSr5laaVHG95Vs2gN+ZzQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795096558; 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=CmKWQB6KlaYVglcyUQcDT5BMLUUrU2SqGIG/uv68sXt9OVVSMjyQSKT8fOJvmrFMfyv8 SZHvpkpTu/9McNR5Pamj+As8arbg6H8ZNx1QmNdCg9fHfnp4ITIPF+x8oDbUhxmxbSWYP 2XS+0cFwLXFcNu7v0Dilml6DD6UlOiejQ41AaSpLMa701+9G65IXpJ1om0GqIturPSrBp iEK4ztdD9teRrG/vaVatOpPLOD7108TTzx7Otws2GCcvhBcwkjI+ZgEN0pVT8WzjW0E91 IRVw1tIKou18JwA2KGmZjWEmZqM0x8cuo/bA+xZeXi6sHFv9i8VYiRJ/tKbXkMTx39A== 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=PPIlOG7E; 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 29B29606A325; Thu, 19 Nov 2026 13:55:58 +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=PPIlOG7E X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.94 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795096552; b=ZVUJLpRIj77HDiLHFaCTR/6y/4tiVeCVUp3KwPP6twjpsltR86PHn8F2Pp/Xlom0rEp0 v6ZZJAzfAa4Lj7HtIKZk3zUF7Li3pZjHYSim9mdK/wGbXL/Ci5ehvjJM3T0/ezuMgir9v XPjo1BDhCR2W8sb1Zykt4Epe96R7c04iB30VlWRPadusWGx8ZRqhKdOWEVySVhWkSNAEj LF5CKmvIg5H/APCsro5d/jk5Qrjsi8f+5PwmtZEwa+RViYciCA9rTjwP30/apqZn6487b u0S7He63t8c/ob814hrHZhpxr5U8BNrT/gTIzMlLFboEyQOR+bR6fvjB7ErgkyBzXcg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795096552; 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=3973XSkeUnwIT2v3F6b18I8r53TR84sMRdpKNyDhQLT+PDFyhsKnZQd4sAk9QoMkmotq aj4qlVBX4nEgbOqUf3BQ1PlgdL252f2g64ziAWyCPCTiSF1o8HGKhNOukACcWEQ6gnTzC HsoWTu8upQs7vh3rSnIshd2XipPvAUh40Rrj3L+a5CGXWEXboKcGh/k095rMAJ8lXTFVR PVmiaWdQyC+P8/l2zR2wu8Cq0vfKMq95BxTv5YJdUOAIqYVPe0gg7aRBMH2CeUTHGi1St 6UyEtnTXO6FNmnpirMD7EfDO4Ks79NxODCsYQkH/QNKKeJL3IUgHhNA1tzAWlF+EPWQ== 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=PPIlOG7E; arc=none smtp.remote-ip=95.215.58.94 X-Received: from mta1.migadu.com (out-94.mta1.migadu.com [95.215.58.94]) (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 A7A77606A324 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 13:55:51 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A7A77606A324 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=1795096549; v=1; x=1795701349; b=PPIlOG7ET5TwjZksD7PrJ8+DkyyfVP4Wdwzoaze0WA/1ZKJE6Cc1TdQACHk3vDIh2avdKarR lr0zUrlZSsJ7gsWgMlNxxfbmzu3B3DDxfgrtHDHGL2gi2yLyQz8nIFxW5hPQAUNLlmpiAFX4OW+ Chb2g/9eZ0a98PtecpLfvN/w= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id ebd9ad4d2a421d3f; Thu, 19 Nov 2026 13:55:49 +0000 X-Mizu-Trace-ID: ebd9ad4d2a421d3f 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: <20261119-srv6_flavors_endx-v4-0-284cdb484eee@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