From: Hangbin Liu <hangbin.liu@linux.dev>
To: Andrea Mayer <andrea.mayer@uniroma2.it>
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>,
andrea@common-net.org
Subject: Re: [PATCH net-next 2/5] seg6: handle a consumed SRH in SRv6 End with the PSP flavor
Date: Tue, 13 Oct 2026 08:29:02 +0800 [thread overview]
Message-ID: <as17Tl9qMVEEA6vr@fedora> (raw)
In-Reply-To: <20261012234039.162d27bd311a5027a9beb641@uniroma2.it>
On Mon, Oct 12, 2026 at 11:40:39PM +0200, Andrea Mayer wrote:
> On Mon, 12 Oct 2026 17:28:06 +0800
> Hangbin Liu <hangbin.liu@linux.dev> wrote:
>
> > [snip]
> > >
> > > +/* look up the SRH to be processed by the RFC8986 flavors. As End does, a
> > > + * routing header with SL = 0 is skipped (e.g. an SRH already consumed).
> > > + * This function returns NULL when no valid SRH is found.
> > > + */
> > > +static struct ipv6_sr_hdr *seg6_flv8986_get_srh(struct sk_buff *skb)
> > > +{
> > > + struct ipv6_sr_hdr *srh;
> > > +
> > > + srh = seg6_get_srh(skb, IP6_FH_F_SKIP_RH);
> > > + if (srh)
> > > + return srh;
> > > +
> > > + /* we take the first routing header without skipping it. In this way,
> > > + * seg6_get_srh_pktinfo() reports SL = 0 and not a missing SRH.
> > > + */
> > > + return seg6_get_srh(skb, 0);
> > > +}
> > > +
> > > /* process the packet on the basis of the RFC8986 flavors set for the given
> > > * SRv6 End behavior instance.
> > > */
> > > @@ -837,7 +858,7 @@ static int end_flv8986_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
> > > __u32 flvmask;
> > > int srhoff;
> > >
> > > - srh = seg6_get_srh(skb, 0);
> > > + srh = seg6_flv8986_get_srh(skb);
> >
> > Hmm, here we always try skip the SL = 0 SRH when multi SRH exists. What if
> > we want to add USP flavor support in future? Then we will not able to remove
> > the first SRH which SL = 0, right? e.g.
> >
> > +------+----------------------+----------------------+---------+
> > | IPv6 | SRH, Segments Left 0 | SRH, Segments Left 2 | payload |
> > +------+----------------------+----------------------+---------+
> >
> > Thanks
> > Hangbin
> >
>
> Hi Hangbin,
> thanks for the review and for testing the series.
>
> As it is now, seg6_flv8986_get_srh() skips that SRH, while with USP it
> should be removed. USP is not supported today, and for PSP without USP,
> skipping that SRH is correct.
>
> When USP is implemented, that SRH can still be removed, for example by
> extending seg6_flv8986_get_srh() to take the flavors into account. Its
> comment would then be updated as well.
>
> Does that sound reasonable to you?
Yes, this looks good to me. Thanks for the explanation. With this extendable
interface:
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
next prev parent reply other threads:[~2026-10-13 0:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 19:23 [PATCH net-next 0/5] seg6: fixes for the PSP flavor of SRv6 End Andrea Mayer
2026-10-11 19:23 ` [PATCH net-next 1/5] seg6: handle a Fragment or AH header before the SRH consistently in PSP Andrea Mayer
2026-10-12 7:59 ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 2/5] seg6: handle a consumed SRH in SRv6 End with the PSP flavor Andrea Mayer
2026-10-12 9:28 ` Hangbin Liu
2026-10-12 21:40 ` Andrea Mayer
2026-10-13 0:29 ` Hangbin Liu [this message]
2026-10-11 19:23 ` [PATCH net-next 3/5] seg6: apply the PSP flavor together with NEXT-C-SID in SRv6 End Andrea Mayer
2026-10-12 8:17 ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 4/5] selftests: seg6: add tests for PSP together with NEXT-C-SID Andrea Mayer
2026-10-12 7:54 ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 5/5] selftests: seg6: add tests for PSP with a consumed SRH Andrea Mayer
2026-10-12 8:19 ` Hangbin Liu
2026-10-12 19:26 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=as17Tl9qMVEEA6vr@fedora \
--to=hangbin.liu@linux.dev \
--cc=ahabdels@cisco.com \
--cc=andrea.mayer@uniroma2.it \
--cc=andrea@common-net.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=justin.iurman@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=stefano.salsano@uniroma2.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®