Netdev List
 help / color / mirror / Atom feed
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 3/5] seg6: apply the PSP flavor together with NEXT-C-SID in SRv6 End
Date: Thu, 15 Oct 2026 08:54:30 +0800	[thread overview]
Message-ID: <atAkRpVssWDpyx9-@fedora> (raw)
In-Reply-To: <20261015000052.7731f972b28eb12ab57dd93c@uniroma2.it>

On Thu, Oct 15, 2026 at 12:00:52AM +0200, Andrea Mayer wrote:
> On Mon, 12 Oct 2026 16:17:41 +0800
> Hangbin Liu <hangbin.liu@linux.dev> wrote:
> 
> > [snip]
> > > +static bool seg6_flv8986_enabled(__u32 fops)
> > > +{
> > > +	return fops & SEG6_LOCAL_FLV8986_SUPP_OPS;
> > > +}
> > > +
> > > +/* check whether the NEXT-C-SID processing has to be used for the packet,
> > > + * instead of the RFC8986 flavors set for the given SRv6 End* behavior
> > > + * instance.
> > > + *
> > > + * This function returns:
> > > + *  - true, when the packet has to go through the NEXT-C-SID processing;
> > > + *  - false, when NEXT-C-SID is not configured or the packet has to be
> > > + *    processed on the basis of the RFC8986 flavors.
> > > + */
> > > +static bool seg6_use_next_csid(struct sk_buff *skb,
> > > +			       const struct seg6_flavors_info *finfo)
> > > +{
> > > +	const struct in6_addr *addr;
> > > +	__u32 fops = finfo->flv_ops;
> > > +
> > > +	if (!seg6_next_csid_enabled(fops))
> > > +		return false;
> > > +
> > > +	addr = &ipv6_hdr(skb)->daddr;
> > > +
> > > +	/* NEXT-C-SID and the RFC8986 flavors combine according to the
> > > +	 * DA.Argument (see RFC9800, sections 4.1.1 and 4.1.7):
> > > +	 *
> > > +	 *       DA.Argument   RFC8986 flavors   processing
> > > +	 *   (1) != 0          any               NEXT-C-SID only, SL unchanged
> > > +	 *   (2) == 0          none              the behavior, e.g. End
> > > +	 *   (3) == 0          one or more       the behavior with its flavors,
> > > +	 *                                       e.g. End with PSP
> > > +	 *
> > > +	 * In (2), the packet still goes through the NEXT-C-SID processing,
> > > +	 * which runs the behavior (e.g. End) when the DA.Argument is zero.
> > > +	 */
> > > +	return !seg6_flv8986_enabled(fops) ||
> > > +	       !seg6_next_csid_is_arg_zero(addr, finfo);
> > 
> > nit: based on the comment, maybe we can change the order to
> > 
> > 	return !seg6_next_csid_is_arg_zero(addr, finfo) ||
> > 	       !seg6_flv8986_enabled(fops);
> > 
> > No need to change if there is no new version patch.
> > 
> > > +}
> > 
> > [snip]
> 
> Hi Hangbin,
> 
> thanks for the review and for the suggestion. I would prefer to keep
> this order. The table in the comment is meant to describe the cases
> rather than the order of the checks. Since testing the 32-bit flavor
> mask can be cheaper than checking the DA.Argument, I just put the mask
> test first.
> 
> Let me know if you see it differently.

Yes, putting the mask test first makes sense to me.

Thanks
Hangbin

  reply	other threads:[~2026-10-15  0:54 UTC|newest]

Thread overview: 17+ 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
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-14 22:00     ` Andrea Mayer
2026-10-15  0:54       ` Hangbin Liu [this message]
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
2026-10-15  1:45     ` Andrea Mayer

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=atAkRpVssWDpyx9-@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