Article View: linux.kernel.netdev
Article #3391Re: [PATCH net-next 3/5] seg6: apply the PSP flavor together with NEXT-C-SID in SRv6 End
From: Hangbin Liu
Date: Thu, 15 Oct 2026 00:54
Date: Thu, 15 Oct 2026 00:54
71 lines
8644 bytes
8644 bytes
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
Technical Details
Message-ID:
<atAkRpVssWDpyx9-@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-346477-linux-kernel-netdev=dewy.ruReferences:
<20261011192310.55-1-andrea.mayer@uniroma2.it> <20261011192310.55-4-andrea.mayer@uniroma2.it> <asyXpWXMeKnPw9U6@fedora> <20261015000052.7731f972b28eb12ab57dd93c@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-346477-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <atAkRpVssWDpyx9-@fedora> References: <20261011192310.55-1-andrea.mayer@uniroma2.it> <20261011192310.55-4-andrea.mayer@uniroma2.it> <asyXpWXMeKnPw9U6@fedora> <20261015000052.7731f972b28eb12ab57dd93c@uniroma2.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2419989"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:f9dtBQ91G28IAGU12csW382l2HI= sha256:BmF8PQ6CVXyhMUqvFwTaPkVWBKfObWj0FMhhX+e8SpI= sha1:CMOtOgcSQSkCqHU162ydr6kfbTc= sha256:Cg+V4AoO/umHLbHqsHC1a4tr7F7E192GqjiON8Qiiws= 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 31C21110205; Thu, 15 Oct 2026 03:54:57 +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.25, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-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 KVwF2YZYivJT; Thu, 15 Oct 2026 03:54:54 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-346477-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id E6ABE110008; Thu, 15 Oct 2026 03:54:44 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 74B4A37EB8; Thu, 15 Oct 2026 00:54:43 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C7582D837C; Thu, 15 Oct 2026 00:54:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="SE4RzuVO" X-Received: from mta0.migadu.com (out-100.mta0.migadu.com [91.218.175.100]) (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 8522C282F34 for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 00:54:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.100 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792025682; cv=none; b=MEisdjfxPLOFzbxSNQCOudcHfPnwRunOAXWKfg4ul2ftvBZ+SAq+HhAkx3bhj70ZIdcsGtBJl8k8xbCOGB+qeqk24nUvx3rPi2gLeOy0JKIJ3VfXVqlX2Ef26UGNeYQJWxRuE/O+qmPBgiTBY718xlEttfA2CWoLJr9bKJ3FiZM= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792025682; c=relaxed/simple; bh=r247dczbk+8j7HVrazYqB4jq4GEyWT/BBF98AxWtuB8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TEJcrUioOFRU3NGDIjnAveMPlMi6rvAas3LFgkmDqJqe42soyARryj4vkp/6fZecKmNdOlM8YV97J1BJGC7dQFe41m8v8lISHMupoDN0YMTiMIuxz467+Yze6I/0K7ckdjs67bvc9hF12qjwFj8F7aYkEBU0hpf0U0EruTvu+ZE= 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=SE4RzuVO; arc=none smtp.client-ip=91.218.175.100 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=r247dczbk+8j7HVrazYqB4jq4GEyWT/BBF98AxWtuB8=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1792025678; v=1; x=1792630478; b=SE4RzuVOWBfqDbbWmdLh+Oxecw401ihk60GUM7rm7cXZyltp45UG3LSkJ3Ju3W8/aF6xrw9l jEBYhbzYoACrrOHpXccNirXLrIsOQqOSazOQLXlrJu2mmiKwjT5CvutLfDA7ytOxK7vVwmWaJwD uVSFpBAh+9MA8QRZqrwokSmE= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 57c161504278a604; Thu, 15 Oct 2026 00:54:37 +0000 X-Mizu-Trace-ID: 57c161504278a604 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>, andrea@common-net.org 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: <20261015000052.7731f972b28eb12ab57dd93c@uniroma2.it>