Article View: linux.kernel.netdev
Article #16588Re: [PATCH net-next 04/10] net/mlx5e: TC, refuse a tunnel key wider than the VNI
From: Alexandre Cassen
Date: Sun, 15 Nov 2026 09:10
Date: Sun, 15 Nov 2026 09:10
69 lines
11331 bytes
11331 bytes
On 11/11/26 20:12, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Low]
> The commit message says the problem exists today ("An exact key above bit
> 23 already selects the wrong VNI"). Should the patch carry a Fixes: tag,
> and maybe go through net?
>
> The truncation does look reachable in the current tree. Flower parses
> TCA_FLOWER_KEY_ENC_KEY_ID with TCA_FLOWER_UNSPEC as the mask type, so every
> enc_key_id rule is an exact 32 bit match. The parsers then write the key
> into 24 bit fields:
>
> mlx5e_tc_tun_parse_vxlan() {
> ...
> MLX5_SET(fte_match_set_misc, misc_v, vxlan_vni,
> be32_to_cpu(enc_keyid.key->keyid));
> ...
> }
>
> mlx5e_tc_tun_parse_geneve_vni() {
> ...
> MLX5_SET(fte_match_set_misc, misc_v, geneve_vni, be32_to_cpu(enc_keyid.key->keyid));
> ...
> }
>
> In mlx5_ifc.h, vxlan_vni and geneve_vni are 0x18 bits wide, so MLX5_SET()
> masks off bits 24-31.
>
> The VXLAN-GBP path in mlx5e_tc_tun_parse_vxlan() also loses those bits. It
> shifts the key left by 8 into the 32 bit tunnel_header_1:
>
> MLX5_SET(fte_match_set_misc5, misc_v, tunnel_header_1,
> be32_to_cpu(enc_keyid.key->keyid) << 8);
>
> As a result, a skip_sw rule with enc_key_id 0x01000001 is offloaded as a
> match on VNI 1. Software never matches that rule.
>
> Because this fixes a mismatch that already exists, a Fixes: tag would tell
> backporters which stable trees are affected. These look like the
> candidate targets:
>
> 9272e3df3023 ("net/mlx5e: Geneve, Add support for encap/decap flows
> offload") for the geneve_vni MLX5_SET()
>
> the original en_tc.c commit that added VXLAN VNI matching, for the
> vxlan_vni MLX5_SET(). d386939a327d ("net/mlx5e: Rearrange tc tunnel code
> in a modular way") later moved that code into tc_tun_vxlan.c.
>
> eacc77a73275 ("net/mlx5e: Use custom tunnel header for vxlan gbp") for
> the tunnel_header_1 path
v2 adds Fixes tags for 9272e3df3023 and for bbd00f7e2349 ("net/mlx5e:
Add TC tunnel release action for SRIOV offloads"), the en_tc.c commit
that added the vxlan_vni match.
eacc77a73275 gets no tag. Before it, a GBP rule went through the 24 bit
vxlan_vni field. That commit moved the same truncation to
tunnel_header_1, and bbd00f7e2349 covers it...
> Would it also make sense to send this to net as a standalone fix, rather
> than untagged as part of the net-next series that adds flower partial
> masks?
No. The bug needs a key that no VNI can carry, the rest of the series
depends on these checks. v2 keeps the patch on net-next with the tags.
Technical Details
Message-ID:
<a8ac012c-dd21-4974-99d5-ae037163ff6b@corp.free.fr>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363624-linux-kernel-netdev=dewy.ruReferences:
<20261109131039.959438-5-acassen@corp.free.fr> <179442432378.2199510.219572665710096354@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363624-linux-kernel-netdev=dewy.ru From: acassen@corp.free.fr (Alexandre Cassen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 04/10] net/mlx5e: TC, refuse a tunnel key wider than the VNI Date: Sun, 15 Nov 2026 10:10:04 +0100 Organization: Usenet Network Message-ID: <a8ac012c-dd21-4974-99d5-ae037163ff6b@corp.free.fr> References: <20261109131039.959438-5-acassen@corp.free.fr> <179442432378.2199510.219572665710096354@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1760776"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:CSB9MXcmcWe9vjtZIAMw+kWNVyY= sha256:ld1bz2QPzsv6qL/JibafXHvkzIOUFHoX4Q2J/5LI1e0= sha1:vLOiG+E/Ak+XkBXd3Rb3t0QH+ak= sha256:o4bH01fyThg7sXhzgwzWpUeZ9t9gGTv4z4l9YCxNYno= Content-Language: en-US List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 45979114980; Sun, 15 Nov 2026 12:10:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=corp.free.fr X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qx2O7oY65aTx; Sun, 15 Nov 2026 12:10:27 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363624-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=corp.free.fr X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 9CC8C11497A; Sun, 15 Nov 2026 12:10:16 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id C85EA2E446; Sun, 15 Nov 2026 09:10:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794733809; b=GcjZfIzseABW0IrbmHVENeMdl/mVyCrxtGHur6uNVLmKx4Q5GGcwaCHwAeCHk3/jgNO6 GDgjA/BknqsF/C8ZGpAZ+Ju16Fkm+oaudatYc9BGcQW/D2yvgRTTAizd7kpm9TYMUwDPc sJ29xYld5eRI5LAmrOz/t/q5f+fAbldaiBL8rSlgehqhFVdNbmpDfZvj8pJwgpbbNPMQW Yf5FT2E+UZqr9BZaPM/8wNsnfIqyalbWdvTeTh2gbPBnV2klkWvrpFyvg61/EqcSqxTL3 tlBdmqGZmTrmWapVnmkAQzFGSnCPb4xN682r/9mhWznxbbfyeObRNklyN0kKCqzvaJA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794733809; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received: Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=GDbKjw2zYrrhLWmvqxa/QL+sQBlzT+HT64ai1BN7vIA=; b=JdRd+zfYU6agqwys1FW9uyjvK78pMpSPZuIvX9CM6fhHX09QGSMwG9gSmUXpoYdqzyII b1z5g8+mVqs9AB1OOuZP4Q0ZwmUn6w8w7hAaDqoPmdRO5azZHBDolL9QipgwEJBn51NE4 kRjOStwk2ene7K2z2GwTsSojbWfLnpFihxtqcVoIkgDEPv8X+Or8cfYmRSxWkWyjqBMe/ 5niOFcBLwXsl1vltLVno1j3yfUJIW3yBH0bOpVHjpkK2YZmvaIEM8uPE4LXYixLqZh5de Y6qtKf59vuDqGptBb/OwvdpKwo/iwRTCSG1fq6jhRviJpEvaY5eBbYzcProTURwNq5w== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=GIZASXuq; dmarc=pass header.from=corp.free.fr; spf=pass smtp.mailfrom=corp.free.fr; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A467606A334; Sun, 15 Nov 2026 09:10:09 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=GIZASXuq X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=212.27.60.169 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794733808; b=oLlstX3l9jyCgz7a9BWWQ42NdpdcYiQS7YdxPItYe4qn0VJNHx5r5KZRvRD3FSVWekPJ p0/1H+fm8/FVylYYOHdJ0gG36OdBKsZ3Tu51PH7pVB8l3hL9x9Hrr20m72Z+zoqOC0qcu S3bwKtBl2aQ07/920U+kXUqVmGvrmdyQDg3bfjpplve9NtL0IGikxxl96KH47qIkbyIcw M9N+hiWqumVaXRAPRYUGxnSxLx3pTi+x7hmBgnCj84mvBXHxRS4IdoCuTEGIlLY968QmY 71CfT8z4cRLBWgW+4uPs8QionoKoCmJSJ9GJFvblXPmAm5SIa9LpVG74CZuN0JTJbAg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794733808; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=GDbKjw2zYrrhLWmvqxa/QL+sQBlzT+HT64ai1BN7vIA=; b=yOk6wCyRCCft0+4g68pfrgPH0YaiGlXPbGPeNt0zuG0ZIeG8/Ul5+i59oVAgln8X7LAw uupnu9eoDqrX9arDxLyriK2pCdG4iVHjTFEoWEwNTUGei5f/o+2sLSui1OyEutPITPu9A dcAnY/61H8pIEPeRzN17jgPpQC62wbbUYpiZc+IfRktoK1FcfaoEImuTohlyJEb//hBRu A5AXzKFp8SGJbqJSP7ej63z9gJWJIsfea+g6ktZ6n/oaLUshvKKQaHGY3CHfJrdePdnHO kygwgfyhnIwNLq8ytqmYhf7bFfedW53MXusn7LChpWhSMlQAQshGhdbm4+zYZ3Y+exQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=corp.free.fr; spf=pass smtp.mailfrom=corp.free.fr; dkim=pass header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=GIZASXuq; arc=none smtp.remote-ip=212.27.60.169 X-Received: from rcs.proxad.net (rcs.proxad.net [212.27.60.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B218606A31A; Sun, 15 Nov 2026 09:10:08 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2B218606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=corp.free.fr X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=corp.free.fr X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=corp.free.fr; s=rcs; t=1794733806; bh=hsiAKW8RObdKWucm0HbAf9+FVwSRO5DEpMI7eRA2Rtk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GIZASXuq/Hclhh/Tl1fosY0vvtMqxPWvWvt9+mg0+59vrNqM481qBhFSZl1oMOrSN +7LBA6oMgXICyaI/vNabCWtGElkxe53sUlRVMZBXP/E31LYJ7Cssf5fkEb0MG9BBjP hEM0S71EGsXNjVRWTtZahgOqNmF3QY5a4ahywgDVEnAkXfTXH+yzwkYwcPnbTNVu+K K9HbYPFRICqZfxD0UxQ8CJnZeYzAljZrhhQjKM31M8ADmbcFqrEBlyHlz8IgmB3dLT +N8uHL0+wPKIE3GM101lKljtDEE7FmwWJTVDdBdvH25nhqZ4UCTGAArN0xnIz698Hn CmM9PeKNlEgHA== X-Received: from [0.0.0.0] (unknown [213.228.1.188]) by rcs.proxad.net (Postfix) with ESMTPSA id BC03444C0083; Sun, 15 Nov 2026 10:10:04 +0100 (CET) X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-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 X-In-Reply-To: <179442432378.2199510.219572665710096354@kernel.org>