๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23999

Re: [PATCH net-next v3 07/12] net/sched: flower: add psp_spi, psp_ver, and psp_dev matches

#23999
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 23:57
84 lines
11761 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new uAPI attribute TCA_FLOWER_KEY_PSP_VERSION is documented
  in two places in a way that contradicts how it is validated.

--

net/sched: flower: add psp_spi, psp_ver, and psp_dev matches

This adds a flow dissector key that is filled from the PSP Rx state
(SKB_EXT_PSP) of a decrypted packet. It also adds flower matches on the Rx
SPI, the PSP version and the PSP device ID. Rules that use these matches are
never offloaded, and they are rejected when skip_sw is set.

> diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
> index 14cff8f5da746..0cfa7425404bd 100644
> --- a/include/uapi/linux/pkt_cls.h
> +++ b/include/uapi/linux/pkt_cls.h
> @@ -561,6 +561,11 @@ enum {
>  	TCA_FLOWER_KEY_ENC_FLAGS,	/* be32 */
>  	TCA_FLOWER_KEY_ENC_FLAGS_MASK,	/* be32 */
>  
> +	TCA_FLOWER_KEY_PSP_SPI,		/* be32 */
> +	TCA_FLOWER_KEY_PSP_SPI_MASK,	/* be32 */
> +	TCA_FLOWER_KEY_PSP_VERSION,	/* u8, enum psp_version */
> +	TCA_FLOWER_KEY_PSP_DEV,		/* u32, PSP device ID */
> +
>  	__TCA_FLOWER_MAX,
>  };
>  
> diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
> index 23eba4a00a947..d7b6250f417bc 100644
> --- a/net/sched/cls_flower.c
> +++ b/net/sched/cls_flower.c

[ ... ]

> @@ -745,6 +763,12 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = {
>  	[TCA_FLOWER_KEY_SPI]		= { .type = NLA_U32 },
>  	[TCA_FLOWER_KEY_SPI_MASK]	= { .type = NLA_U32 },
>  	[TCA_FLOWER_L2_MISS]		= NLA_POLICY_MAX(NLA_U8, 1),
> +	[TCA_FLOWER_KEY_PSP_SPI]	= { .type = NLA_BE32 },
> +	[TCA_FLOWER_KEY_PSP_SPI_MASK]	= { .type = NLA_BE32 },
> +	/* the version field of the PSP header has 4 bits */
> +	[TCA_FLOWER_KEY_PSP_VERSION]	= NLA_POLICY_MAX(NLA_U8, 15),

[Severity: Low]
Should the uAPI comment and this policy agree on what the attribute holds?

The pkt_cls.h comment above says "u8, enum psp_version". The kernel-doc for
struct flow_dissector_key_psp in include/net/flow_dissector.h also says
"PSP version (enum psp_version)". In include/uapi/linux/psp.h, that enum
only defines the values 0 to 3:

enum psp_version {
	PSP_VERSION_HDR0_AES_GCM_128,
	PSP_VERSION_HDR0_AES_GCM_256,
	PSP_VERSION_HDR0_AES_GMAC_128,
	PSP_VERSION_HDR0_AES_GMAC_256,
};

fl_policy accepts values up to 15 here. The key-psp-version entry in
Documentation/netlink/specs/tc.yaml also uses "max: 15". The PSP genetlink
family checks the same enum for PSP_A_ASSOC_VERSION with
NLA_POLICY_MAX(NLA_U32, 3).

So fl_set_key() accepts psp_ver 4 through 15, but those rules can never
match. Rx SPIs and associations can only be created for versions 0 to 3
that the device lists in psd->caps->versions. The key value comes from
psp_dev_rcv(), which stores the raw 4-bit header field:

    pse->version = FIELD_GET(PSPHDR_VERFL_VERSION, psph->verfl);

This is new uAPI. Could the attribute be documented as the raw 4-bit PSP
header version field instead? Or could the policy and the spec be capped
at the highest enum psp_version value?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124221758.3230929-1-toddfreed%40meta.com
Technical Details
Message-ID: <179591022485.3135.15275082044719436517@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer03.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-373293-linux-kernel-netdev=dewy.ru
References: <20261124221758.3230929-8-toddfreed@meta.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer03.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-373293-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 07/12] net/sched: flower: add psp_spi, psp_ver, and psp_dev matches
Date: Sat, 28 Nov 2026 23:57:04 +0000
Organization: Usenet Network
Message-ID: <179591022485.3135.15275082044719436517@kernel.org>
References: <20261124221758.3230929-8-toddfreed@meta.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1062375"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jmRr2wc3S4UPIP616pGI3KMX+es= sha256:AcSLG/mGMKLx8J1LLluyj3NzjwHjYA4TTXJbRxXEMUs= sha1:wiNBrsGtPXdmPivRtl5B9VRQmTs= sha256:BiKY9Yk7ZheCay7qBuQhkOY3zx8hcD6fnbgQJyHD7oE=
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 B53D4125F88; Sun, 29 Nov 2026 02:57:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
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 nk78Xvoh8txN; Sun, 29 Nov 2026 02:57:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373293-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EEB75125F8E; Sun, 29 Nov 2026 02:57:22 +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 B809A27F37; Sat, 28 Nov 2026 23:57:10 +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=1795910228; b=EuJOVc5SffdVdCWvVZjYp2YrW/83y94F7d44UcO4GKcUBrg4akvjEAp4WfefpfCZRcDw 1VELzXPrAkvNktkFqhuxsYWTTX/AYJs+tyAqxHyAp02PI6OaTXrcZGBQTdFJEL/Gtpbbi GCOBaOe7cB/sB6BMZRGUHhq2iZi5c1ATRAIoooIYrbnm1un61YUWC6bVfTPOhi9j1RrpY 0KnWcb8Kjge/o/3BSD8Ne9TUgYUEltPhulgait0P+s3TqqL8pVxLMzEVI/5I6RqPmdVh7 v8usG59y0ye3FzT/PRbQviKm25AbmPrSgKTjgOPfGkZ5jHQGB87LGbtjI/UNihwclnQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795910228; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=Rf9xLgaCekJ7NS/rRE+hJxOaYGW3ntDK779TZqNuUac=; b=MS25T6+O0FMcd/XEdkFDoatqpvV3LD6MkzNVdEh7aN1PSRv9gt4jQO9ZucmyewOmxJfY kbF3k63xPXjNV2SB6DT55zwU9t/slVC1EHmxsZb/rZjHB7cQ6116KomDiNRSeD5BtfDgU vvbjx4g9zAwPuF7vwmTrBw8+YRm3imfCewVfcO+oyrCTadL8gcdYJbliRKCTxVCv1ab84 xu0wKzjSIcmB4H3FgamrSIKeX+uPjdUh960Zmj1Bcz0KTweXODX9xdVAXxVZmXUY6BxFz KkYihEhxLn7iy7Iax1O8Rhsed4Glb4Zdb3AaaEPDGQWUYBlWIHwYiVKGfLEv6y13l+w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awsLZqxz; 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 70E65606A335; Sat, 28 Nov 2026 23:57:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awsLZqxz
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795910227; b=4so1v9VJ7GONFNLGUqAjhDb147vzkiApkq4NwknF+R7n4eyYIyIq6EVXsBCba5PidIeT o7GKFUWP/6TYRWmzf+vSEqgJFt7ut1UXxyv68wziZxCwhMf+tuaQ3zjQvNqeeaLloJzBW Ysf6tena1CUg9n8xrwR65mU68mBzEiTOozOlNQWmnXTNC7orhjJd+J7eQZL4bZdmH5Khi yCCxqv2v8xd8UYHedMdc4v+Y+PnepX6CIzYdv/zHDjgNqrmsmEsOAxQ+VjG/mBc6yLxJC esCdndta4arCZGcwqFaapXmR6Z7L+8LZ3Uu0YVb8XAQnlT9EMjmEQ0kAwV8LBlGH4sg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795910227; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=Rf9xLgaCekJ7NS/rRE+hJxOaYGW3ntDK779TZqNuUac=; b=JTQDZljRQdcs8D6qrf4gJuuJt9+2K8otWFN1Z/pG6X5CthItuODX6xRMDVIKF9zVZJE2 hP5SDs0rFexkGxMB2skCpUyLCuXJEGAkC9JZ+dorz+yO3wAftD3AU5v+xFt6J75qwAOXP v9hxQaRWzfvSEKq0ILQillimc8MjoQd0R88RtyCEIVhDa2o0uRJpcMQ0bdPaJ28HwB06q YK7MEw8bFG9SpjXWzhTghjuuq5cJKrVR7GWk8XylEPkTsD5RmXdc80BPh6SwGT6MsQXmj AZIr1ISAvGChhKcH/pscH4eySNj95SFyw7ozFUfhkqfUFJU85d0HJ1Kkc31oa1ZsV0g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=awsLZqxz; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EBA5606A684; Sat, 28 Nov 2026 23:57:07 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A8A91F0089A; Sat, 28 Nov 2026 23:57:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795910227; bh=Rf9xLgaCekJ7NS/rRE+hJxOaYGW3ntDK779TZqNuUac=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=awsLZqxzSpevluHCefjiQ093TwsBqDwgwkSCYVtFSb7AFfHOH8j/SryBLq+17FEiw PxjPhhkt4irx8fgAvKeWN7uAn2iMzY+nf1OKws5xPB0q88A4D8M2V3VEcH8D27pBEL oJcxAXnTQIfoMVqLzm8OeDwfiGnOu9xaJU5KLUmeHwVc9QnR0oT5ZfzZlqj8MogVQF t11rnDBgf396T0rUhrEyfodZSllEZh5bzk8kXN4B6turITek8w5lKPPp7vBoduQj5S 2OI+lbqEwf5bHXvc/8rw0nXv7aGGGHeoVIOs51VLwi/pSjiiqK9QPgVCuGzHmN/sj+ E41//HnD6rW5w==
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, andrew+netdev@lunn.ch, bjorn@kernel.org, borisp@nvidia.com, cratiu@nvidia.com, daniel.zahka@gmail.com, donald.hunter@gmail.com, dtatulea@nvidia.com, edumazet@kernel.org, kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us, leon@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, pabeni@redhat.com, pctammela@mojatatu.com, saeedm@nvidia.com, horms@kernel.org, tariqt@nvidia.com, weiwan@google.com, willemdebruijn.kernel@gmail.com, kuniyu@google.com, bpf@vger.kernel.org, ast@fiberby.net, qingfang.deng@linux.dev, toke@redhat.com, shuah@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, matttbe@kernel.org, dsahern@kernel.org, j.koeppeler@tu-berlin.de, hangbin.liu@linux.dev
X-In-Reply-To: <20261124221758.3230929-8-toddfreed@meta.com>
X-sashiko-severity: Low
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-Received-Bytes: 11502