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
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 [thread overview]
Message-ID: <179591022485.3135.15275082044719436517@kernel.org> (raw)
In-Reply-To: <20261124221758.3230929-8-toddfreed@meta.com>
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
next prev parent reply other threads:[~2026-11-28 23:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 22:17 [PATCH net-next v3 00/12] psp: introduce socket-less associations Todd Freed
2026-11-24 22:17 ` [PATCH net-next v3 01/12] psp: get netns from net_device instead of sock Todd Freed
2026-11-24 22:17 ` [PATCH net-next v3 02/12] psp: take the psp nexthdr from the packet on encap Todd Freed
2026-11-26 14:32 ` Björn Töpel
2026-11-24 22:17 ` [PATCH net-next v3 03/12] psp: declare psp_assoc_set_tx() in psp.h Todd Freed
2026-11-24 22:17 ` [PATCH net-next v3 04/12] psp: add support for socket-less psp associations Todd Freed
2026-11-26 15:07 ` Björn Töpel
2026-11-24 22:17 ` [PATCH net-next v3 05/12] net: add METADATA_PSP dst to carry a psp association on an skb Todd Freed
2026-11-25 22:19 ` sashiko-bot
2026-11-26 15:27 ` Björn Töpel
2026-11-28 23:56 ` netdev-bot+sashiko
2026-11-24 22:17 ` [PATCH net-next v3 06/12] net/sched: add act_psp for psp transport mode Todd Freed
2026-11-25 22:19 ` sashiko-bot
2026-11-26 15:45 ` Björn Töpel
2026-11-28 23:57 ` netdev-bot+sashiko
2026-11-24 22:17 ` [PATCH net-next v3 07/12] net/sched: flower: add psp_spi, psp_ver, and psp_dev matches Todd Freed
2026-11-28 23:57 ` netdev-bot+sashiko [this message]
2026-11-24 22:17 ` [PATCH net-next v3 08/12] selftests: drv-net: psp: test socket-less associations and the tc psp action Todd Freed
2026-11-28 23:57 ` netdev-bot+sashiko
2026-11-24 22:17 ` [PATCH net-next v3 09/12] selftests: drv-net: psp: test that software encap on ingress drops Todd Freed
2026-11-24 22:17 ` [PATCH net-next v3 10/12] selftests: tc-testing: run dependsOn probes outside the test namespace Todd Freed
2026-11-28 23:57 ` netdev-bot+sashiko
2026-11-24 22:17 ` [PATCH net-next v3 11/12] selftests: tc-testing: add tests for the psp action Todd Freed
2026-11-24 22:17 ` [PATCH net-next v3 12/12] Documentation: networking: psp: document socket-less associations Todd Freed
2026-11-28 23:57 ` netdev-bot+sashiko
2026-11-25 22:19 ` [PATCH net-next v3 00/12] psp: introduce " sashiko-bot
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=179591022485.3135.15275082044719436517@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@fiberby.net \
--cc=bjorn@kernel.org \
--cc=borisp@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=cratiu@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=dtatulea@nvidia.com \
--cc=edumazet@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=horms@kernel.org \
--cc=j.koeppeler@tu-berlin.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matttbe@kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pctammela@mojatatu.com \
--cc=qingfang.deng@linux.dev \
--cc=rdunlap@infradead.org \
--cc=saeedm@nvidia.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.com \
--cc=toddfreed@meta.com \
--cc=toke@redhat.com \
--cc=weiwan@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/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