From: netdev-bot+sashiko@kernel.org
To: acassen@corp.free.fr
Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
mbloch@nvidia.com, jhs@mojatatu.com, jiri@resnulli.us,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
bharat@chelsio.com, donald.hunter@gmail.com, corbet@lwn.net,
skhan@linuxfoundation.org, rdunlap@infradead.org,
dsahern@kernel.org, idosch@nvidia.com, shuah@kernel.org,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
oss-drivers@corigine.com
Subject: Re: [PATCH net-next 03/10] nfp: flower: refuse a tunnel key wider than the VNI
Date: Wed, 11 Nov 2026 19:12:01 +0000 [thread overview]
Message-ID: <179442432180.2199510.17732935950535223359@kernel.org> (raw)
In-Reply-To: <20261109131039.959438-4-acassen@corp.free.fr>
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] In drivers/net/ethernet/netronome/nfp/flower/offload.c, the new
nfp_flower_check_tun_vni() fixes a bug that already exists.
--
nfp: flower: refuse a tunnel key wider than the VNI
This patch adds nfp_flower_check_tun_vni() so that VXLAN and GENEVE flower
rules are refused when the enc_key_id key does not fit in the 24 bit VNI.
The check runs in nfp_flower_calculate_key_layers() after the UDP tunnel
type is known. GRE keeps its 32 bit key.
> diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
> index 161190200dbd0..e5f6f4f464ad6 100644
> --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
> +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
> @@ -150,6 +150,23 @@ static bool nfp_flower_check_higher_than_l3(struct flow_rule *rule)
> flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ICMP);
> }
>
> +static int
> +nfp_flower_check_tun_vni(struct flow_rule *rule,
> + struct netlink_ext_ack *extack)
> +{
> + struct flow_match_enc_keyid enc_keyid;
> +
> + if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_KEYID))
> + return 0;
> +
> + flow_rule_match_enc_keyid(rule, &enc_keyid);
> + if (be32_to_cpu(enc_keyid.key->keyid) < VXLAN_N_VID)
> + return 0;
[Severity: Low]
The commit message says "An exact key above bit 23 already selects the
wrong VNI", so this check also fixes a bug that exists today. Should the
patch carry a Fixes: tag and a stable Cc so that stable trees get it too?
Before cls_flower accepts an enc_key_id mask, fl_set_key() passes
TCA_FLOWER_UNSPEC as the mask attribute. That means any enc_key_id that is
present always gets an exact mask:
net/sched/cls_flower.c:fl_set_key() {
...
fl_set_key_val(tb, &key->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID,
&mask->enc_key_id.keyid, TCA_FLOWER_UNSPEC,
sizeof(key->enc_key_id.keyid));
...
}
nfp_flower_compile_tun_udp_key() then shifts the key and the mask left by
NFP_FL_TUN_VNI_OFFSET (8), which throws away bits 24-31:
drivers/net/ethernet/netronome/nfp/flower/match.c:nfp_flower_compile_tun_udp_key() {
...
vni = be32_to_cpu((match.key->keyid & match.mask->keyid)) <<
NFP_FL_TUN_VNI_OFFSET;
*key |= cpu_to_be32(vni);
vni = be32_to_cpu(match.mask->keyid) << NFP_FL_TUN_VNI_OFFSET;
*key_msk |= cpu_to_be32(vni);
...
}
So on current and stable kernels, a VXLAN or GENEVE rule with enc_key_id
0x01000005 gets programmed into the NIC as VNI 5 with mask 0xffffff00. The
hardware then matches VNI 5 traffic. In software the rule never matches,
because VXLAN and GENEVE tunnel ids are only 24 bits wide.
The Fixes: tag would need to point at the commit that first added
VXLAN/GENEVE VNI matching to nfp flower. Commit 77a5f73a8b33 ("nfp: flower:
move udp tunnel key match compilation to helper function") only moved this
code and says it makes no functional change, so the original commit is
older than that one.
> +
> + NL_SET_ERR_MSG_MOD(extack, "unsupported offload: tunnel key does not fit the 24 bit VNI");
> + return -EOPNOTSUPP;
> +}
> +
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109131039.959438-1-acassen%40corp.free.fr
next prev parent reply other threads:[~2026-11-11 19:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 13:10 [PATCH net-next 00/10] tc flower: tunnel key partitioning for RX queue steering Alexandre Cassen
2026-11-09 13:10 ` [PATCH net-next 01/10] bnxt_en: require an exact tunnel id in TC flows Alexandre Cassen
2026-11-09 13:10 ` [PATCH net-next 02/10] cxgb4: flower: refuse a tunnel key wider than the VNI Alexandre Cassen
2026-11-11 19:11 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 03/10] nfp: " Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko [this message]
2026-11-09 13:10 ` [PATCH net-next 04/10] net/mlx5e: TC, " Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 05/10] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 06/10] net/sched: cls_flower: add enc_key_id mask Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 07/10] selftests: forwarding: tc_flower: test the " Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 08/10] net/mlx5e: TC, offload RX queue mapping in NIC flows Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 09/10] net/mlx5e: TC, match the tunnel key without a tunnel device Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
2026-11-09 13:10 ` [PATCH net-next 10/10] docs: networking: describe tunnel key partitioning in TC queue filtering Alexandre Cassen
2026-11-11 19:12 ` netdev-bot+sashiko
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=179442432180.2199510.17732935950535223359@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=acassen@corp.free.fr \
--cc=andrew+netdev@lunn.ch \
--cc=bharat@chelsio.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=rdunlap@infradead.org \
--cc=saeedm@nvidia.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.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