Article View: linux.kernel.netdev
Article #16961Re: [PATCH net-next v3 3/5] selftests: seg6: move SRv6 End PSP setup into its own helper
From: Hangbin Liu
Date: Mon, 16 Nov 2026 06:20
Date: Mon, 16 Nov 2026 06:20
97 lines
12195 bytes
12195 bytes
Hi Andrea,
On Mon, Nov 16, 2026 at 05:26:59AM +0100, Andrea Mayer wrote:
> > [snip]
> > diff --git a/tools/testing/selftests/net/srv6_end_flavors_test.sh b/tools/testing/selftests/net/srv6_end_flavors_test.sh
> > index 157baa8ecb0b..0ed5bfe99029 100755
> > --- a/tools/testing/selftests/net/srv6_end_flavors_test.sh
> > +++ b/tools/testing/selftests/net/srv6_end_flavors_test.sh
> > @@ -488,8 +488,9 @@ cleanup()
> >
> > # check whether the setup phase was completed successfully or not. In
> > # case of an error during the setup phase of the testing environment,
> > - # the selftest is considered as "skipped".
> > - if [ "${SETUP_ERR}" -ne 0 ]; then
> > + # the selftest is considered as "skipped", unless a test has already
> > + # recorded a failure.
> > + if [ "${SETUP_ERR}" -ne 0 ] && [ "$ret" -ne "$ksft_fail" ]; then
> > echo "SKIP: Setting up the testing environment failed"
> > exit "${ksft_skip}"
> > fi
>
> When a test has already failed and the setup then fails, the script
> exits with 1 and does not say that the setup failed. For example, with
> hs-2 -> gw failing and then an error in setup_end_flv_psp(), the last
> TEST lines in the log are:
>
> TEST: IPv6 Hosts connectivity: hs-1 -> gw [ OK ]
> TEST: IPv6 Hosts connectivity: hs-2 -> gw [FAIL]
>
> The End PSP tests did not run. Before this patch, the setup ran before
> any test, and cleanup() printed "Setting up the testing environment
> failed" on every setup error. Could cleanup() print it also in this
> case, keeping the exit code 1? Something like:
>
> if [ "${SETUP_ERR}" -ne 0 ]; then
> if [ "${ret}" -ne "${ksft_fail}" ]; then
> echo "SKIP: Setting up the testing environment failed"
> exit "${ksft_skip}"
> fi
>
> echo "FAIL: Setting up the testing environment failed"
> fi
>
> exit "${ret}"
OK, I will fix it.
> > # see __setup_rt_policy
> > @@ -962,17 +980,29 @@ setup()
> > setup_hs 1 1
> > setup_hs 2 2
> >
> > - # set up the loopback addresses of the hosts used by the Policies (i.c)
> > - # and (i.d).
> > - setup_hs_lo_addr 1 1 "${END_CSID_PSP_FUNC}"
> > - setup_hs_lo_addr 2 2 "${END_CSID_PSP_FUNC}"
> > -
> > # set up default SRv6 Endpoints (i.e. SRv6 End behavior)
> > setup_rt_local_sids 1 "2 3 4"
> > setup_rt_local_sids 2 "1 3 4"
> > setup_rt_local_sids 3 "1 2 4"
> > setup_rt_local_sids 4 "1 2 3"
> >
> > + # testing environment was set up successfully
> > + SETUP_ERR=0
> > +}
> > +
> > +setup_end_flv_psp()
> > +{
> > + SETUP_ERR=1
> > +
> > + # set up the loopback addresses of the hosts used by the Policies (i.c)
> > + # and (i.d).
> > + setup_hs_lo_addr 1 1 "${END_CSID_PSP_FUNC}"
> > + setup_hs_lo_addr 2 2 "${END_CSID_PSP_FUNC}"
> > +
> > + # setup proxy on route entries for hosts
> > + setup_rt_host_proxy 1 2 "${END_CSID_PSP_FUNC}"
> > + setup_rt_host_proxy 2 1 "${END_CSID_PSP_FUNC}"
> > +
> > # set up SRv6 policies
> > # create a connection between hosts hs-1 and hs-2.
> > # The path between hs-1 and hs-2 traverses SRv6 aware routers.
>
> Before this patch, __setup_rt_policy() added the proxy entry together
> with the route of each Policy. With this patch, each scenario calls
> setup_rt_host_proxy() instead.
>
> In this v3, 4/5 deletes the proxies when the scenario ends, like the
> routes of the Policies. So I think the proxy entry can stay in
> __setup_rt_policy(), and in 4/5 its defer can go next to the defer of
> the route. What do you think?
OK, I will keep the proxy set up in __setup_rt_policy.
Thanks
Hangbin
Technical Details
Message-ID:
<avqgyRcQkWLvpiA9@fedora>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364074-linux-kernel-netdev=dewy.ruReferences:
<20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn> <20261112-srv6_flavors_endx-v3-3-c9177bbbd965@kylinos.cn> <20261116052659.e8843a373807242737faeef0@uniroma2.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364074-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 3/5] selftests: seg6: move SRv6 End PSP setup into its own helper Date: Mon, 16 Nov 2026 14:20:57 +0800 Organization: Usenet Network Message-ID: <avqgyRcQkWLvpiA9@fedora> References: <20261112-srv6_flavors_endx-v3-0-c9177bbbd965@kylinos.cn> <20261112-srv6_flavors_endx-v3-3-c9177bbbd965@kylinos.cn> <20261116052659.e8843a373807242737faeef0@uniroma2.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1993884"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:fOa/AHaZ7/ibGqO1/yGMRGeUEJk= sha256:7VH/g67AWaQmitV4VdbJUxI/m/havrFOWeXjfDHQPIo= sha1:2BcuI8W63o9URDNieicws7ab194= sha256:v9a4mN3cAedWebO+6YfxSR8FeeR5eFLkDdW+72zqL5g= 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 91842114B3A; Mon, 16 Nov 2026 09:21:29 +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 4LCAwhAtc7sT; Mon, 16 Nov 2026 09:21:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364074-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 409C7114B0B; Mon, 16 Nov 2026 09:21:15 +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 DC06030DF8; Mon, 16 Nov 2026 06:21:12 +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=1794810072; b=NoVMWJqahdRvzOw6rq6ODqpYqhu484qMH/0bJXfkm1Vx/4gKiSSoUR32/SIAM47+Qcm+ Wo/e1C6khqTqJnYDd2wYnE7W8hr6EEBQSS3dnP5gqBr05Ntw13s04B90gbhdmVUV2t4vI 3stbBz+Lko9CWu9BpQASsBDtogWObmX4JQoFialOkh79Ghv94WrVeGBWZmKdH3XSpeWX2 YzryYEUK9ZS0XFq/zI0mwN7q70izrmU6F63SOyZLf0vXffYHvUIZJwB6ZEKElThVjOdEx XPB+DFb2K4ceqebes9Aushs3FQ7SaRTkpGHYEsrmt2KLHM5e8/QjGItzIWvn6uvh+Aw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794810072; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=LrWqePIA2dRTl7gYO+GfHcmbC6K7NaHxnw6+i+GpqQw=; b=5o3f5H0l+pQcRcm5slrrkbGqo1euZqiuUu5WTe1burLlEFr3ggnYXvYjy80uB9HPRlON qdXvsby7gUFHOs0Kev6KGerS44bE3rSgAUnJKuAe0RI9h7K2CDvyulnR8rTlRAqlUeGye 8U+DnXKktVuyoifKzdwjTTrOiTsY0yMHI8i53mh5rR9Fg8u5pWAXLHYqnamK5KyBQMFL+ InjkBV0lwxQEOC16h7mEJVJjpA3J9d5CgAHq/TYTzcMAWAYwwfPi/hGGLDJi+cfjRhd+E kJaDyw3CFFbk9+fJ2TkHQVITPGUdBsG17DPGt6OMc2jun0/IvGasB0XTadW9liY3f+w== 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=UbqegxeK; 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 AFF5B606A32A; Mon, 16 Nov 2026 06:21:12 +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=UbqegxeK X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.112 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794810071; b=bEmiJqOXWJJq/wWQzePV1GVFiMSLLawIlP4g7eJ4kybFuaBcfJWr3M4TN52kLHVbGUbH cRmEStrI7Jvp9BIw0m2Mx/HbZ+zlwD0rjVR+YtEJMgYOSQfV3p/2s9q8dL7w8/VS7Gakb vW80SQAPAkCvspnP6Z0RLZeqdliHYHI5Z+ph7bX5o1qwujtWs/1rDQE5lqLTEz24p5Cxn 1WjMd0j0ctWynLLV+qFcVwHwLjJNPqglvxayKVL3olRQYb1T5Z82B1OrJuUL3o2KC+CnS GQ394JQ9p9YC37QJOXGxxu9VolQEIWJwHMjUzhV5RWU0oqQGJaczFhiaOMOSOFxGxtA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794810071; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=LrWqePIA2dRTl7gYO+GfHcmbC6K7NaHxnw6+i+GpqQw=; b=hR3saPnd845TUzcffMVuuZ5O8xBuhGFoQNfAeG1SRAFNmZ5LR5Xr7ucfn4Xun+O+NCzI P0SOucJSRbAE5ltEX5c+paLnjuvmCSa0nd3lXjrPGX7IC4a5Mx7632IrjkppzN5kLJ5OR HctjdqRdntuai4A4l0DABQ+F/XO0QrFIh0GZKL9lYLj2iHEoNks4qQNS1nd/Rr1tk5vVn ppEYxLNg/Ro8TH5t0iiChEf9LpfSmr9hUt8d3gbIjCoM8DaNhwHTXn65iCni2IFgrH55y ifEgIr1mv+qp/CAPS9m81Ga0SW97EBxoTYzbLcKyqBntJz9fHRYSyKQJ2rF9jE0qQsQ== 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=UbqegxeK; arc=none smtp.remote-ip=95.215.58.112 X-Received: from mta1.migadu.com (out-112.mta1.migadu.com [95.215.58.112]) (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 DA83C606A323 for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 06:21:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DA83C606A323 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=82DVlU1A65d2Os+X64YwR4fF5H6GyPEMAPG89PFIji8=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794810068; v=1; x=1795414868; b=UbqegxeK8YBLfncOs+okLzUNa3QCOA8D49D5hsiU8UMy4wE7u/Dp72h77j9+f3YaTlLZgf5d EFI4XfoszHwYSeIGePhhoBFrvdFBnkom9ilbiU/lBFG6TJB6wqrd/TnpjhNPTfdrf06dLQylIXw ZkOY5G5+irqxl+1K4LQ480Cc= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id 92b96a1db4b59b3b; Mon, 16 Nov 2026 06:21:07 +0000 X-Mizu-Trace-ID: 92b96a1db4b59b3b 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>, Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Hangbin Liu <liuhangbin@kylinos.cn>, Stefano Salsano <stefano.salsano@uniroma2.it>, Andrea Mayer <andrea@common-net.org> 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: <20261116052659.e8843a373807242737faeef0@uniroma2.it>