Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Fri, 06 Nov 2026 06:06
Re: [BUG] net/mlx5: nf flowtable offload rules never hit in switchdev - root chain misses to slow path, not to the FT chain
Author: netdev-bot+sashiko
Date: Fri, 06 Nov 2026 06:06
Date: Fri, 06 Nov 2026 06:06
117 lines
12268 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads