Linux Documentation
 help / color / mirror / Atom feed
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 v3 09/11] net/mlx5e: TC, reject tunnel keys without a tunnel device
Date: Mon, 23 Nov 2026 21:34:33 +0000	[thread overview]
Message-ID: <179546967317.3135.11320901240553136005@kernel.org> (raw)
In-Reply-To: <20261122213200.3207385-10-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] The new rejection in __parse_cls_flower()
  (drivers/net/ethernet/mellanox/mlx5/core/en_tc.c) returns the extack…

--

net/mlx5e: TC, reject tunnel keys without a tunnel device

This commit rejects flower rules that use enc_* dissector keys when
filter_dev is not a tunnel device. It applies to both NIC and eswitch
flows. Before this change those keys were silently dropped from the
hardware match.

Link: https://github.com/acassen/research/tree/main/UPF-flow-steering [1]

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> index 2326fb21da66b..eab4d5417ce24 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> @@ -2786,6 +2786,17 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
>  		err = mlx5e_tc_verify_tunnel_ecn(priv, f, &match_inner_ecn);
>  		if (err)
>  			return err;
> +	} else if (dissector->used_keys &
> +		   (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
> +		    BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS))) {
> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "Tunnel keys are only supported on tunnel devices");

[Severity: Low]
Is this extack message accurate for NIC mode flows?

In NIC mode the filter_dev passed down is always the mlx5e netdev itself:

mlx5e_setup_tc_cls_flower()
    return mlx5e_configure_flower(priv->netdev, priv, cls_flower,
                                  flags);

The only indirect block registration in mlx5 is the
flow_indr_dev_register() call in mlx5e_rep_tc_netdevice_event_register(),
and only the uplink representor init path calls it. So tunnel filter_devs
only exist in switchdev mode.

In NIC mode, a rule such as "tc filter add dev <mlx5 netdev> ingress
flower skip_sw enc_dst_ip ..." takes this path:

mlx5e_setup_tc_cls_flower()->mlx5e_configure_flower()->mlx5e_tc_add_flow()
    ->mlx5e_add_nic_flow()->parse_cls_flower()->__parse_cls_flower()

The rule is still rejected with -EOPNOTSUPP. However, the message tells
the user to use a tunnel device, and a rule added on a vxlan or gretap
device would never reach mlx5 in NIC mode.

The follow-up patch "net/mlx5e: TC, match the tunnel key without a tunnel
device" changes this string to "Tunnel keys other than enc_key_id require
a tunnel device". Wouldn't that wording mislead NIC mode users in the
same way for the remaining enc_* keys?

Could the message say that these keys need switchdev mode and a tunnel
device, or use a different message for NIC flows?

> +		return -EOPNOTSUPP;
>  	}
>  
>  	err = mlx5e_flower_parse_meta(filter_dev, f);

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122213200.3207385-1-acassen%40corp.free.fr

  reply	other threads:[~2026-11-23 21:34 UTC|newest]

Thread overview: 17+ 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-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-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-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 [this message]
2026-11-22 21:31 ` [PATCH net-next v3 10/11] net/mlx5e: TC, match the tunnel key " Alexandre Cassen
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

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=179546967317.3135.11320901240553136005@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