🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12018

Re: [BUG] net/mlx5: nf flowtable offload rules never hit in switchdev - root chain misses to slow path, not to the FT chain

#12018
From: netdev-bot+sashiko
Date: Fri, 06 Nov 2026 06:06
117 lines
12268 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit cannot be merged as written.
- [Low] The patch fixes a long-standing functional bug: in switchdev
  mode, mlx5 nf flowtable hardware offload rules never get hit, so…

--

net/mlx5: nf flowtable offload rules never hit in switchdev - root chain misses to slow path, not to the FT chain

This commit moves the mlx5_chains_set_end_ft() call in esw_chains_create()
so it runs before the root (chain 0, prio 1) table is opened. As a result,
mlx5_chains_create_prio() uses nf_ft as the root's miss destination instead
of the slow path tc_miss_table, and nf flowtable hardware offload rules can
be hit in switchdev mode.

> net/mlx5: nf flowtable offload rules never hit in switchdev - root chain misses to slow path, not to the FT chain
>
> Hi,

[ ... ]

> The order changed in "net/mlx5: Refactor multi chains and prios support"
> (Sep 2020, merged for v5.10), which introduced esw_chains_create() with
> mlx5_chains_set_end_ft() after the root is opened.

[Severity: Low]
The culprit commit is named here, but the message has no Fixes: tag and
no Cc: stable. At the baseline, git blame on esw_chains_create() shows that
the root prio open and the late mlx5_chains_set_end_ft() call both come
from ae430332557a.

Should the message carry this tag:

Fixes: ae430332557a ("net/mlx5: Refactor multi chains and prios support")

Without it, stable tooling may not pick up the fix. The report was made on
a 6.12 based kernel, and the message says the code is unchanged through
v7.4-rc1.

[ ... ]

> Suggested fix (against mainline; compile/runtime UNTESTED on my side)
> ---------------------------------------------------------------------

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> index c712848b202db..445aad4fac2bf 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> @@ -1693,6 +1693,11 @@ esw_chains_create(struct mlx5_eswitch *esw, struct mlx5_flow_table *miss_fdb)
>  		goto nf_ft_err;
>  	}
>  
> +	/* Set the end table before opening the root, so the root's miss
> +	 * rule points to the nf flowtable chain and not to the slow path.
> +	 */
> +	mlx5_chains_set_end_ft(chains, nf_ft);
> +
>  	/* Always open the root for fast path */
>  	ft = mlx5_chains_get_table(chains, 0, 1, 0);
>  	if (IS_ERR(ft)) {

[Severity: Medium]
The reordering looks correct. Once mlx5_chains_set_end_ft() is moved up,
mlx5_chains_create_prio() picks the root prio's miss destination at a point
where chains_end_ft() already equals nf_ft:

lib/fs_chains.c:mlx5_chains_create_prio() {
    ...
        next_ft = (chain == mlx5_chains_get_nf_ft_chain(chains)) ?
                  chains_default_ft(chains) :
                  chains_end_ft(chains);
    ...
}

The next_ft == chains_end_ft(chains) check in mlx5_chains_add_miss_rule()
still holds, so the only change to the root miss rule is its destination.
This matches the root to nf_ft wiring that was measured after the
workaround rule was deleted.

The commit can't be applied in this form, though. The changelog is the bug
report email pasted in as is. It starts with:

  Hi,

and ends with:

  Suggested fix (against mainline; compile/runtime UNTESTED on my side)

It also has no Signed-off-by line. The subject describes the symptom
instead of being an imperative summary.

Could this be resent as a [PATCH net] with these changes?

- a Signed-off-by line
- an imperative subject, such as "net/mlx5: Set FDB chains end table
  before opening the root prio"
- a trimmed changelog
- test results from running this diff

All the numbers in the message come from the prio 2 tc filter workaround,
not from this change.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/AM0PR02MB4307F6D53A2B0AD628D91C81C6682%40AM0PR02MB4307.eurprd02.prod.outlook.com
Technical Details
Message-ID: <179394516873.994134.1671850395426244837@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357765-linux-kernel-netdev=dewy.ru
References: <AM0PR02MB4307F6D53A2B0AD628D91C81C6682@AM0PR02MB4307.eurprd02.prod.outlook.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357765-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [BUG] net/mlx5: nf flowtable offload rules never hit in switchdev
 - root chain misses to slow path, not to the FT chain
Date: Fri, 06 Nov 2026 06:06:08 +0000
Organization: Usenet Network
Message-ID: <179394516873.994134.1671850395426244837@kernel.org>
References: <AM0PR02MB4307F6D53A2B0AD628D91C81C6682@AM0PR02MB4307.eurprd02.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3806091"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:scMVRCmoQaUbslgVzNhmS1bN26c= sha256:PV5fptMK/oaQRnfXFwwPSufA3eSD9OaZXpobVi+aono=
	sha1:x12B1ZF63byuUcEyWWPX8xXP9tc= sha256:DFKspcBUlkVYsylCsQoQh9L8BlbSBTqLP3qcC5j7cJM=
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 114A111316F; Fri,  6 Nov 2026 09:09:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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=kernel.org
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 7NRjzRPqGn-d;
	Fri,  6 Nov 2026 09:09:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-357765-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 806F8112E19; Fri,  6 Nov 2026 09:09:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id B3F2820888; Fri,  6 Nov 2026 06:06:16 +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=1793945176;
	b=cHvp+8GcpYvljKD4bvnoLv5k3WXVOkrQNPQ/cWBwwmtJ1Y0I8vgG24rzk2eVKWn2L9ld
	 LfXQFmEG7mxkxVQXIe2tJWwSobbtaF+U76Ix9ph77aiaz9Mwu+aQkIVR3LzopfTtyZ0Jc
	 IvYP5X1d0vaeA+yFNUWsJ87MaEWJKiuxa1ZgRdBTnKJ/kOV+jG4enaMR//0Se+a/AbH2o
	 1kOCv/6Rok/X+l2jJS/grgJMABP9l07aGHuMnvpVpbF1P1U9L/Z7cYNYxurVvmjgkgiYH
	 RtCjxs1E0Us44iJPbt2D1IXlSNkxgSfgJh+jcCHtQJdoYUxL0WIHjZ8FBidK4mwZdYg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793945176;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=gVTTJvwocEtm1PMNVMKTeSVxoE9g7JiIg2s+hJaYmhc=;
	b=fGUYnofdgbvxdYWQZpasp0rzNIk0B3bjL5x73oOd5bOsD0HuvxqSTYotnOoBTth3Zxek
	 jq5ouqZssi2wlc9HEc4hyy+sjH25o+Vk5/M3kDQ8+PxFaXLafT7ZtQosxe9M/75TyJrOY
	 q2xdk04wnzlsa+/LIjrwGIbUDm9s23Q764r/12PgMkpoo0xDzoLq/EikPac+NBCXnqSii
	 xqwqATyCWW/zRTfLkQ9jvgcLVwL1EOi0Mbbm5CaCKUKk77YP4G35yHyme0xv6ISkXk7Zo
	 1TyhxHJC8yoGBHvP8bQjlwmY6/cowqB/1+HsmLDDQG0JipwpnaApIuzuQ0bleADLrpg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZHG6eBV+;
	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 07718606A332;
	Fri,  6 Nov 2026 06:06:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZHG6eBV+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793945170;
	b=OdZkpT2we/d81u2rGqtrTXPCArSg4OxnNZ91kDzBYzZKRdT4QnLKC10e95RCVKvPXvQG
	 k6xbYFMPCk42nvYZ36i9SxAiXqUaR/sree/7qlohw3lU98f1x67pUdBUUkgYfCnwh++ON
	 h3tLaR/BKFczFaMe6fJ4bYoKkB+1bOAzrVX2VWHpQn3TwOt/HEEdpCnJiYMwrQh9ziq5J
	 KeU29Gl+DbQcSfCz7Hu5v1cxub7OI9qgYxcjclaa8ujnvW9DwpcvCHSKZqlFfne2FLkKr
	 jARhNJThlo4A6az1FPq7JgfKU0Cu9JOjNQ62f2JkBWeipSMQZdluvHCT5/L2fDPKO2g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793945170;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=gVTTJvwocEtm1PMNVMKTeSVxoE9g7JiIg2s+hJaYmhc=;
	b=owOnXYj0dpOgMs/qrsPfggBEDFsCOXxKjJHFPG9DHwcTe1lpnpcBRSQAKDosK5oLPefx
	 LBvBDVIpnGU3Zng02JIwwoJduJ6p88JoYbSwR3ng7mHxsvB03ImlwVijHr4UIaibRmzwT
	 hJ4tRpK6MNtwiXtZZ9O86hYkEOLg9UflTOYntgcweZ97tAQAfMjxYuaQWADLRRU8iiJCD
	 1Gy3Z9fknHQ2P0rBVcspOADB5qSOuiKXBmBYcBgTwuBq12D1O37NRCDSyXCbj0ZB/6SRI
	 38Nqb2VNNxNqum5D9Ln1DZY5Fp+pjntNaxG9dpI2DjOqUq9DG1gFXiNl+/W77uwL6CQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZHG6eBV+;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 D5099606A328;
	Fri,  6 Nov 2026 06:06:09 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42CB21F0089F;
	Fri,  6 Nov 2026 06:06:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793945169;
	bh=gVTTJvwocEtm1PMNVMKTeSVxoE9g7JiIg2s+hJaYmhc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ZHG6eBV+q9bv55sb54HBFxlorpjO25JQMN4caUt60ZGLh6Ya7DUDmiovKC+YRL2/S
	 GQFvEnjsztl9FsbtwLjihznoFqOG64LEeVI+Peb2eJReL+L8FJx8JmPLx2mkoF651e
	 UAsts/s8BUghu3s42fP2hLyT+h4uehOq5nQk5hEqDZpxPDn3ve4o7PoBKUZrugQj+Q
	 hU1jp3upQuAl9FWa2I2Mrzd0ce3K+vugjyV4fnGz4GzTKtmV7m9rnElBNgORcglj+4
	 5q8RbHAu6ALfWjrpN/JGWLDe1k8ARkXmEW55UobCRwbwRQykCRJG25vysxWA9lTR4W
	 qOSfE9CyfKqSw==
X-Cc: netdev@vger.kernel.org, saeedm@nvidia.com, leonro@nvidia.com,
 tariqt@nvidia.com, mbloch@nvidia.com, linux-rdma@vger.kernel.org,
 kuba@kernel.org
X-In-Reply-To: <AM0PR02MB4307F6D53A2B0AD628D91C81C6682@AM0PR02MB4307.eurprd02.prod.outlook.com>
X-sashiko-severity: Medium
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