Article View: linux.kernel.netdev
Article #25622Re: [PATCH net-next v5 5/5] selftests: seg6: add PSP flavor testing for SRv6 End.X
From: Hangbin Liu
Date: Wed, 02 Dec 2026 05:46
Date: Wed, 02 Dec 2026 05:46
139 lines
14200 bytes
14200 bytes
On Wed, Dec 02, 2026 at 04:38:55AM +0100, Andrea Mayer wrote:
> > [snip]
> > > > Hi Andrea, The changelog line is getting extremely long. Please let me
> > > > know if you'd like me to split this into smaller pieces. Thanks a lot
> > > > for your kind review.
> > >
> > > To me most of the changes look tied together. The new helpers are
> > > added for the End.X elements, and without the End.X scenario their
> > > End.X parts would have no user.
> > >
> > > One part that could be split out is the read back of the route in
> > > the probe. It also applies to the End probe, which is already in the
> > > tree, so it could be its own patch, before this one.
> >
> > Sorry, which probe do you mean? I didn't get.
>
> I mean the read back in __test_kernel_supp_or_ksft_skip(), the
> "route show | grep" after the route is added. It also runs for End,
> while the End probe in the tree, test_kernel_supp_or_ksft_skip(), adds
> the route and does not read it back. This was about your question on
> splitting it into smaller pieces.
Got it, I will split the test_kernel_supp_or_ksft_skip change out, with
rename the sub-function to check_kernel_support. This could make the new
patch smaller.
>
> > [snip]
> > > > + case "${op_type}" in
> > > > + "psp")
> > > > + sid="${LOCATOR_SERVICE}:${adj}::/32"
> > > > + devname="veth-rt-${rt}-${adj}"
> > > > + net_prefix="$(get_network_prefix "${rt}" "${adj}")"
> > > > + ip -netns "${nsname}" -6 route \
> > > > + change unreachable "${sid}" \
> > > > + table "${LOCALSID_TABLE_ID}"
> > > > + defer ip -netns "${nsname}" -6 route \
> > > > + change "${sid}" \
> > > > + table "${LOCALSID_TABLE_ID}" \
> > > > + via "${net_prefix}::${adj}" dev "${devname}"
> > > > + ;;
> > >
> > > This case changes the underlay /32 into an unreachable route and
> > > restores it in the defer. As in the next-csid,psp case below, an
> > > unreachable route for the exact address, e.g. fcff:4::2af1, would
> > > leave the underlay /32 as it is. Or am I missing something?
> >
> > The psp and next-csid,psp use different unreach route
> >
> > psp use fcff:4::/32 or fcff:2::/32
> > next-csid,,psp use exact route like fcbb:0:42a9:20a9:: or fcbb:0:20a9::
> >
> > The previous routing on rt3 for End is
> > fcff:4::/32 table 90 via fcf0:0:3:4::4 dev veth-rt-3-4
> >
> > I changed it to unreachable so End.X doesn't read the nh via it.
>
> I asked if I was missing something on the psp case because the two
> cases of the same function do it in two different ways, and I was
> wondering about the reason behind it. In the current setup the /32
> and the exact route give the same test results, the difference is in
> the effect: while the End.X tests run, the /32 makes every address under
> fcff:4::/32 unreachable on rt-3, e.g. fcff:4::e, the End SID of rt-4.
> The exact route makes only fcff:4::2af1 unreachable, and the underlay
> /32 stays. For the reasons above, I would have used the exact SID in
> the psp case too, as you rightly did in the next-csid,psp case.
I see. I will use the exact route.
>
> > [snip]
> > > > +test_kernel_supp_or_ksft_skip End psp
> > > > +test_kernel_supp_or_ksft_skip End.X psp && HAS_ENDX_PSP=true
> > >
> > > Here the helper exits for End and returns for End.X when the action
> > > is not supported, but its name says that it skips. In v4 the probe
> > > was inside this helper, while in v5 it is on its own, in
> > > __test_kernel_supp_or_ksft_skip(), and returns on every path. Could
> > > the probe be renamed, for example to check_kernel_support(), and called
> > > directly by the End.X line, as check_srh_match_support() is? Then the
> > > helper could always exit when the probe fails, and the test results
> > > stay the same:
> > >
> > > # Exit with ksft_skip when check_kernel_support() fails, e.g. when
> > > # the action with the flavor is not supported.
> > > test_kernel_supp_or_ksft_skip()
> > > {
> > > local action="$1"
> > > local flavor="$2"
> > >
> > > if ! check_kernel_support "${action}" "${flavor}"; then
> > > exit "${ksft_skip}"
> > > fi
> > > }
> > > ...
> > > test_kernel_supp_or_ksft_skip End psp
> > > if check_kernel_support End.X psp; then
> > > HAS_ENDX_PSP=true
> > > fi
> >
> > OK, with this, the End is the only caller of test_kernel_supp_or_ksft_skip().
> > Maybe let End also calls check_kernel_support and exit directly? e.g.
> >
> > if ! check_kernel_support End psp; then
> > exit "${ksft_skip}"
> > fi
> > if check_kernel_support End.X psp; then
> > HAS_ENDX_PSP=true
> > fi
> >
> > If make it shorter
> >
> > ! check_kernel_support End psp && exit "${ksft_skip}"
> > check_kernel_support End.X psp && HAS_ENDX_PSP=true
>
> In general, I prefer to keep the logic in functions. Here,
> test_kernel_supp_or_ksft_skip() would stay for End, and the End.X if
> would go in a small function that sets HAS_ENDX_PSP, as
> check_srh_match_support() sets HAS_SRH_MATCH:
>
> # Set HAS_ENDX_PSP when the kernel supports End.X with the PSP flavor.
> check_endx_psp_support()
> {
> if check_kernel_support End.X psp; then
> HAS_ENDX_PSP=true
> fi
> }
> ...
> test_kernel_supp_or_ksft_skip End psp
> check_endx_psp_support
>
> Your if blocks are shorter, and it is a matter of taste. If you prefer
> them with check_kernel_support() alone, that is fine with me too.
I will keep it with your style.
Thanks
Hangbin
Technical Details
Message-ID:
<aw-wNnf6Bz0AbFF6@fedora>Path:
mbox-mo1.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375574-linux-kernel-netdev=dewy.ruReferences:
<20261126-srv6_flavors_endx-v5-0-4d8232eec404@kylinos.cn> <20261126-srv6_flavors_endx-v5-5-4d8232eec404@kylinos.cn> <20261201011421.0f393abeefcb9c4f3c5f0ee4@uniroma2.it> <aw42oTMEOCMvC22o@fedora> <20261202043855.92f9711185e07636c42a669f@uniroma2.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375574-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 5/5] selftests: seg6: add PSP flavor testing for SRv6 End.X Date: Wed, 2 Dec 2026 13:46:34 +0800 Organization: Usenet Network Message-ID: <aw-wNnf6Bz0AbFF6@fedora> References: <20261126-srv6_flavors_endx-v5-0-4d8232eec404@kylinos.cn> <20261126-srv6_flavors_endx-v5-5-4d8232eec404@kylinos.cn> <20261201011421.0f393abeefcb9c4f3c5f0ee4@uniroma2.it> <aw42oTMEOCMvC22o@fedora> <20261202043855.92f9711185e07636c42a669f@uniroma2.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1899451"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:C0RKtCNw0K0VvvEDBIpQMqc2rTQ= sha256:SzvcvVA5s0epfmM7wHsjoEgh2gDKcPfUOIEJNoTQLok= sha1:2CkmA/aiFFrFnr0nwG8DPTQKh/U= sha256:v7+PQGGxIpXbIJZnV3UIpBGejqwNr70gZBccmq5vvHQ= 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 0773611753C; Wed, 2 Dec 2026 08:47:17 +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 2ZaMjelDtxPV; Wed, 2 Dec 2026 08:47:12 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375574-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 5AFCE117562; Wed, 2 Dec 2026 08:47:03 +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 987673010E; Wed, 2 Dec 2026 05:46: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=1796190418; b=oQCR1rmG/NbTmSAbnS2gUSboycebTeMdOM2dwf4lI1etx9ppxeA9TlDOW0YpxM2W2FIQ tlpXo40DDtUvDeQ46limW5ZakJDjdhNQbS0gzNTXm3UfG+zfuxF9+iASb6zcBkDBGqANw QTQnx9qszJ4wT7V7cYkcaECpwv1mHYH3Muk5KbmeXs/zzZMIdyqLz2ol2HB/e1+MtPwC1 nhsm1N0Qmg2mUbfZJf9Xs5sWZowT8Qs72CPN2v9gETgRVXNdIiQwIPiVOdAkcfSOTUngz Kyagcspr6Ef4/GDmMcqar+rUhEG8jlQWUBNjc6jcQrh+wtxyAZhrDH5yWec/w2qrCRQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796190418; 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=WzMzgZkwgtUOKvXsrcpN8QvmuMwdydZt3907Ku1m9+M=; b=x+4kmhrUclC9ZsdZuByEBi9vJBZUcWTbwWgE/U1nnu1cthkaWODyppQ+NHSUVv60sX8Q J6yrQDbDO3bJVyv+y/9BiCajuN9BZc4WjpP6MlRPbzUU6q8Im7OkkP0gEde16n68HQTyU ys2gDt6WItpOJyvEZswEpVS3tie6nir14RsRtC/MW8YVQfCMZeSoTV6RFEYPye2+1a3TT lp1dbssdaAGDOj1y04a5wUClRz6oA+/Ndw4j0xhfJbH3skI0TdP6SPgxZ3/yMk2pDvLnP 7xrfepaZWJOs9LrweC5ELYLkkY552M2VY67046NVEMLrpg+OvsaJHBojrkzyNVfjQIg== 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=CV6BgFQl; 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 68548606A6A2; Wed, 2 Dec 2026 05:46: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=CV6BgFQl X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.105 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796190417; b=SI4ATtjuOQYbUrMqyXv7KhShrpp9eSulPxfYAw++KDLjoD6v44l4dXxjq7yCUqdorc/v H2ck4dlFIfgv4BG/WmtUfCMJgdspUM93zD27ae4e2dr2XPhLRGeRjXLaz3drzfgThisFV eU9XPJJcrgih6F+B2MoKIj0S5PVTRazqtmo6sOkx3V9giitF2HhohzWBtgNw2256uCvxI X2xD1Xf0OztiXpcK9uUoCP5bHZkritkJsF6lhdQCj0gt6nOZEEAZwu+iE2BWeSYgRXUEN gTh92srWxcb42na07qbGfx8VS+4QAJqEoC+IddAk/j85zNEgv5e3lJ0MY/aWWJSj2aQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796190417; 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=WzMzgZkwgtUOKvXsrcpN8QvmuMwdydZt3907Ku1m9+M=; b=dCquLUj1Xax32B63OsiKhrDokJF08oSRwopo7Ah3yZKguvYH8/igGIgBrz03chTpQJm8 7c/NOhe7uYG6c4tE3avZbBQFAmulaJYULeJEpYjYNczgaVfP3Vhywikt+HuFC3RX4NzDe WlvwF04RurKXW/Y5Wgs94SvOQZhgyasXzuC/DdrKxlWc4ELsjHn2f3UJvVGk7b9asjeMo a3iyUzq9IbbfosSBP19PW6w4s51FAJS0wkEifN7Z/93BnN1KKx+6zMu16hYzoUkXhuIB0 jwBxHwhZrICWBZ866lC5P23Xsgo2XkY/Yatc282vTeALyN7feoeFMlUG2EzV2W0nRdQ== 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=CV6BgFQl; arc=none smtp.remote-ip=91.218.175.105 X-Received: from mta0.migadu.com (out-105.mta0.migadu.com [91.218.175.105]) (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 AFABB606A68A for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 05:46:53 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AFABB606A68A 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=7RljXyjtzQG6xuR0lSXk2b6Ue52rT/dlC7Vy/gUjVPM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796190412; v=1; x=1796795212; b=CV6BgFQld0cpT1mmeYJZVT3pQ1XCaytBNWLovxRe2kQzNS/DQSj76Q/hsPa7EMSr68KtQH4d bcaWzTw94O8RTZpjiPvXFC/j4RoSC/hRBCEUcsNGwpWB034+78qLGBXcjXmHKkQe7ZmrLW8McqY BKd+Fua8TafVorNRrxaUlUxs= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta11.migadu.com with ESMTPS id ce7d225b4d4545f3; Wed, 02 Dec 2026 05:46:52 +0000 X-Mizu-Trace-ID: ce7d225b4d4545f3 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>, Justin Iurman <justin.iurman@gmail.com>, 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: <20261202043855.92f9711185e07636c42a669f@uniroma2.it> X-Received-Bytes: 13914