From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A8A91F0089A; Sat, 28 Nov 2026 23:57:05 +0000 (UTC) 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== Subject: Re: [PATCH net-next v3 07/12] net/sched: flower: add psp_spi, psp_ver, and psp_dev matches From: netdev-bot+sashiko@kernel.org To: toddfreed@meta.com 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 Date: Sat, 28 Nov 2026 23:57:04 +0000 Message-ID: <179591022485.3135.15275082044719436517@kernel.org> In-Reply-To: <20261124221758.3230929-8-toddfreed@meta.com> References: <20261124221758.3230929-8-toddfreed@meta.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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