From: Alexandre Cassen <acassen@corp.free.fr>
To: netdev-bot+sashiko@kernel.org
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 v3 05/11] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping
Date: Fri, 27 Nov 2026 23:19:43 +0100 [thread overview]
Message-ID: <3c82dec8-e3b9-4095-ad40-232dcc811f13@corp.free.fr> (raw)
In-Reply-To: <179546966530.3135.14742631609975673237@kernel.org>
On 11/23/26 22:34, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Low]
> Is this check too strict for VXLAN and Geneve? It compares against a
> 32-bit all-ones mask for every tunnel type. Those tunnels carry a 24-bit
> VNI, so a mask of 0x00ffffff already covers every bit a packet can carry.
>
> Both parsers run before mlx5e_get_flow_tunnel_id(), and they already
> reject keys that don't fit in 24 bits:
>
> mlx5e_tc_tun_parse_vxlan() and mlx5e_tc_tun_parse_geneve_vni():
> if (be32_to_cpu(enc_keyid.key->keyid) >= MLX5E_TC_TUN_N_VNI) {
> NL_SET_ERR_MSG_MOD(extack,
> "Tunnel key does not fit the 24 bit VNI");
>
> The mask is then written into fte_match_set_misc.vxlan_vni[0x18] or
> geneve_vni[0x18]. Both fields are 24 bits wide, so 0x00ffffff and
> 0xffffffff program the same hardware match.
>
> This means the masked key stored in the tunnel mapping is the full VNI.
> key32_to_tunnel_id(key.enc_key_id.keyid) in mlx5e_restore_tunnel() would
> give back the packet's real tunnel id, so the wrong-id restore described
> in the commit message can't happen with this mask.
>
> Once the flower enc_key_id mask patch later in this series is applied, a
> VXLAN or Geneve rule such as "enc_key_id 42/0xffffff ... action goto
> chain 1" would fail here with -EOPNOTSUPP. The same goes for a sample
> action, or for any such rule in a chain above 0. With skip_sw the rule
> is refused, and otherwise it stays in software. Only GRE uses all 32
> bits of the key.
>
> Could the check instead require that the mask covers the full key width
> of the tunnel type? No later patch in the series changes
> mlx5e_get_flow_tunnel_id(), so this limit is still there at the end of
> the series.
No as on v1 and v2 [1]. The exact key matches the same packets and this
works in chains.
[1]
https://lore.kernel.org/netdev/3b3dff0d-e879-4a14-9f17-2b3015b6da39@corp.free.fr/
next prev parent reply other threads:[~2026-11-27 22:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 21:31 [PATCH net-next v3 00/11] tc flower: tunnel key partitioning for RX queue steering Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 01/11] bnxt_en: require an exact tunnel id in TC flows Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 02/11] cxgb4: flower: refuse a tunnel key wider than the VNI Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 03/11] nfp: " Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 04/11] net/mlx5e: TC, " Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 05/11] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping Alexandre Cassen
2026-11-23 21:34 ` netdev-bot+sashiko
2026-11-27 22:19 ` Alexandre Cassen [this message]
2026-11-22 21:31 ` [PATCH net-next v3 06/11] net/sched: cls_flower: add enc_key_id mask Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 07/11] selftests: forwarding: tc_flower: test the " Alexandre Cassen
2026-11-23 21:34 ` netdev-bot+sashiko
2026-11-27 22:28 ` Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 08/11] net/mlx5e: TC, offload RX queue mapping in NIC flows Alexandre Cassen
2026-11-23 21:34 ` netdev-bot+sashiko
2026-11-28 20:14 ` Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 09/11] net/mlx5e: TC, reject tunnel keys without a tunnel device Alexandre Cassen
2026-11-23 21:34 ` netdev-bot+sashiko
2026-11-28 20:16 ` Alexandre Cassen
2026-11-22 21:31 ` [PATCH net-next v3 10/11] net/mlx5e: TC, match the tunnel key " Alexandre Cassen
2026-11-30 13:55 ` Jianbo Liu
2026-11-22 21:31 ` [PATCH net-next v3 11/11] docs: networking: describe tunnel key partitioning in TC queue filtering Alexandre Cassen
2026-11-23 21:34 ` netdev-bot+sashiko
2026-11-29 17:05 ` Alexandre Cassen
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=3c82dec8-e3b9-4095-ad40-232dcc811f13@corp.free.fr \
--to=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-bot+sashiko@kernel.org \
--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