🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2164

Re: [PATCH net-next 4/5] selftests: seg6: add tests for PSP together with NEXT-C-SID

#2164
From: Hangbin Liu
Date: Mon, 12 Oct 2026 07:54
101 lines
9722 bytes
Hi Andrea,
On Sun, Oct 11, 2026 at 09:23:09PM +0200, Andrea Mayer wrote:
> Extend srv6_end_flavors_test.sh with tests for the SRv6 End behavior
> with both the NEXT-C-SID and PSP flavors.
> 
> The tests use two SRv6 Policies with C-SID containers, where every
> router after the ingress one applies End with the NEXT-C-SID and PSP
> flavors. To check PSP, set net.ipv6.conf.all.seg6_enabled to 0 on the
> hosts in setup_hs(). The hosts then drop any packet that still carries
> an SRH, and a ping to an address on the loopback of a host succeeds
> only if the router connected to that host has removed the SRH. The tests
> fail when PSP is not applied together with NEXT-C-SID.
> 
> Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
> ---
>  .../selftests/net/srv6_end_flavors_test.sh    | 229 +++++++++++++++++-
>  1 file changed, 226 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/srv6_end_flavors_test.sh b/tools/testing/selftests/net/srv6_end_flavors_test.sh
> index 30a939392eea..baa1b09a1aab 100755
> --- a/tools/testing/selftests/net/srv6_end_flavors_test.sh
> +++ b/tools/testing/selftests/net/srv6_end_flavors_test.sh
> @@ -439,6 +549,7 @@ setup_rt_local_sids()
>  	local devname
>  	local nsname
>  	local neigh
> +	local csid
>  
>  	nsname="$(get_rtname "${rt}")"
>  
> @@ -452,6 +563,14 @@ setup_rt_local_sids()
>  			add "${LOCATOR_SERVICE}:${neigh}::/32" \
>  			table "${LOCALSID_TABLE_ID}" \
>  			via "${net_prefix}::${neigh}" dev "${devname}"
> +
> +		# set underlay network routes to reach the C-SID containers
> +		# that start with a C-SID of the neighbor, for any Function.
> +		csid="$(build_csid "${neigh}" 00)"
> +		ip -netns "${nsname}" -6 route \
> +			add "${LCBLOCK_ADDR}:${csid}::/${LCBLOCK_NODE_BLEN}" \
> +			table "${LOCALSID_TABLE_ID}" \
> +			via "${net_prefix}::${neigh}" dev "${devname}"
>  	done
>  
>  	# Local End behavior (note that "dev" is a dummy interface chosen for
> @@ -461,6 +580,17 @@ setup_rt_local_sids()
>  		table "${LOCALSID_TABLE_ID}" \
>  		encap seg6local action End dev "${DUMMY_DEVNAME}"
>  
> +	# Local End behavior with the NEXT-C-SID and PSP flavors, bound to the
> +	# C-SID of the router (e.g. fcbb:0:04a1::/48 on rt-4). The /48 prefix
> +	# covers every C-SID container whose first C-SID is this one, whatever
> +	# the Argument that follows.
> +	csid="$(build_csid "${rt}" "${END_CSID_PSP_FUNC}")"
> +	ip -netns "${nsname}" -6 route \
> +		add "${LCBLOCK_ADDR}:${csid}::/${LCBLOCK_NODEFUNC_BLEN}" \
> +		table "${LOCALSID_TABLE_ID}" \
> +		encap seg6local action End flavors next-csid,psp \
> +		lblen "${LCBLOCK_BLEN}" nflen "${LCNODEFUNC_BLEN}" \
> +		dev "${DUMMY_DEVNAME}"

This is a End + PSP specific encapsulation. If there is a new version patch,
can we move this block

> @@ -494,6 +634,7 @@ __setup_rt_policy()
>  	local in_nsname
>  	local rt_nsname
>  	local policy=''
> +	local container
>  	local function
>  	local fullsid
>  	local op_type
> @@ -520,6 +661,15 @@ __setup_rt_policy()
>  			behavior_cfg="End flavors psp"
>  			;;
>  
> +		"next-csid,psp")
> +			# the behavior is already set up on every router by
> +			# setup_rt_local_sids.
> +			container="$(build_csid_container "${node}" \
> +				"${END_CSID_PSP_FUNC}")"
> +			policy="${policy}${container},"
> +			continue
> +			;;
> +

to here? So we can align with the other SRv6 Endpoint behavior?
Because later in the End.X PSP support we also need to cleanup and
re-setup with END.X.

If this version is applied (which is also good), I can do the modification
in my patch set.

Others looks good to me.

Tested-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>

Thanks
Hangbin
Technical Details
Message-ID: <asySKloMDEQmTLpc@fedora>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344777-linux-kernel-netdev=dewy.ru
References: <20261011192310.55-1-andrea.mayer@uniroma2.it> <20261011192310.55-5-andrea.mayer@uniroma2.it>

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-344777-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 4/5] selftests: seg6: add tests for PSP together
 with NEXT-C-SID
Date: Mon, 12 Oct 2026 15:54:18 +0800
Organization: Usenet Network
Message-ID: <asySKloMDEQmTLpc@fedora>
References: <20261011192310.55-1-andrea.mayer@uniroma2.it>
 <20261011192310.55-5-andrea.mayer@uniroma2.it>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1712089"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hm8gPOZZE8gZ6A6jFtLwX4w8LJ8= sha256:P8D5bxgI5wKEyh+YcpMCZriQsdrVl6cJu+pqlEJv//U=
	sha1:PLpnUh/Ei5Uu2CKgFyei/Zkn1h4= sha256:5ohf4PSvvLkKLnDI9XgJ+j5WLdooKswd5aNiSAAXT/Y=
Content-Disposition: inline
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 49CA310FB20; Mon, 12 Oct 2026 10:56:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 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,
	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 qWr4bI_Rgay1;
	Mon, 12 Oct 2026 10:56:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344777-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 933A510FB04; Mon, 12 Oct 2026 10:56:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 1C37A27D24; Mon, 12 Oct 2026 07:54:39 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id ABE0A440A02;
	Mon, 12 Oct 2026 07:54:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uaZJpPPs"
X-Received: from mta1.migadu.com (out-79.mta1.migadu.com [95.215.58.79])
	(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 708204457CA
	for <netdev@vger.kernel.org>; Mon, 12 Oct 2026 07:54:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.79
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791791678; cv=none; b=kPt8C9RG3aOzmOtgRDl4gLR77xjV9kp62s5hKyxXD4kga+aeTkQdS/l6kPmwh4uHY/LnOs+BIvklVZXF/XVIdh+Z/s2UxP5Rs8b9uX31nKL+ts56BPtA85npJBV5JvhPIKy2Jl+i/tjPY90QW7r7w85qMulH0kzoMWJJL9Qvg08=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791791678; c=relaxed/simple;
	bh=BklsQMO+SsIIuSPsxoYOjE73hpbf2LQWVC3wm/IEZVs=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=fSoJt90Zg7ZTVcZI+fKs+nCYym38NDYdfBHhtw05NiWivkGQAYW0KZZ/sbojTaTh/jJpz7zN9HTWVltOChCGhtxI0UODmrmcchdUVCOIWTu2MWnGiugXzo9BkbvgGmjqlKfo8pM4t0x9YLcGbxHL3yLoaVBjnnbbdvS6atg75I4=
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=uaZJpPPs; arc=none smtp.client-ip=95.215.58.79
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=BklsQMO+SsIIuSPsxoYOjE73hpbf2LQWVC3wm/IEZVs=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1791791674; v=1; x=1792396474;
 b=uaZJpPPskEIsb2/scWJvm1zH3qDEU8IZQduwCR0zNH7CxUtrNBLnyw/6Wik6PvQkD7ZtOlHy
 ulFSpx9lUePNPnzHiw8ZyMVENiIQfAP/gOeRUBEi2E67lZj74mEjqI/ZnGCm/EMOx3U3zwn1yKq
 yunHw/cgyQgbPQz2/RJ6wHJo=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta11.migadu.com with ESMTPS id 77d487c906af96b3;
	Mon, 12 Oct 2026 07:54:34 +0000
X-Mizu-Trace-ID: 77d487c906af96b3
X-Migadu-Flow: FLOW_OUT
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	Justin Iurman <justin.iurman@gmail.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Ahmed Abdelsalam <ahabdels@cisco.com>,
	Stefano Salsano <stefano.salsano@uniroma2.it>
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: <20261011192310.55-5-andrea.mayer@uniroma2.it>