Netdev List
 help / color / mirror / Atom feed
From: Alexandre Cassen <acassen@corp.free.fr>
To: Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Potnuri Bharat Teja <bharat@chelsio.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>, Shuah Khan <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: [PATCH net-next v3 01/11] bnxt_en: require an exact tunnel id in TC flows
Date: Sun, 22 Nov 2026 22:31:49 +0100	[thread overview]
Message-ID: <20261122213200.3207385-2-acassen@corp.free.fr> (raw)
In-Reply-To: <20261122213200.3207385-1-acassen@corp.free.fr>

bnxt programs the value of enc_key_id and never reads its mask. Flower is
about to accept partial masks. bnxt would offload them as an exact match
on the masked key. Reject them like the other exact fields.

Found by an AI code review agent while auditing the users of enc_key_id.
Build tested only.

Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index c6b4a14c0e6e..e493c85ecf28 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -1081,6 +1081,13 @@ static bool bnxt_tc_can_offload(struct bnxt *bp, struct bnxt_tc_flow *flow)
 		return false;
 	}
 
+	/* Currently tunnel id cannot be partial wildcard */
+	if ((flow->flags & BNXT_TC_FLOW_FLAGS_TUNL_ID) &&
+	    flow->tun_mask.tun_id != key32_to_tunnel_id(cpu_to_be32(U32_MAX))) {
+		netdev_info(bp->dev, "Wildcard match unsupported for tunnel id\n");
+		return false;
+	}
+
 	/* Currently Ethertype must be set */
 	if (!is_exactmatch(&flow->l2_mask.ether_type,
 			   sizeof(flow->l2_mask.ether_type))) {
-- 
2.43.0


  reply	other threads:[~2026-11-22 21:32 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 ` Alexandre Cassen [this message]
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
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=20261122213200.3207385-2-acassen@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@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