* [PATCH net] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
@ 2026-11-30 10:32 Ziheng Wei
2026-11-30 11:22 ` Petr Machata
0 siblings, 1 reply; 3+ messages in thread
From: Ziheng Wei @ 2026-11-30 10:32 UTC (permalink / raw)
To: Ido Schimmel, Petr Machata, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel
mlxsw_sp_bridge_vlans_flood_set() inserts and walks entries on
bridge_vlan->port_vlan_list via mlxsw_sp_port_vlan->bridge_vlan_node,
but its err_fid_flood_set rollback path instead uses the list member in
list_for_each_entry_continue_reverse().
Use bridge_vlan_node so rollback computes the proper container address
and walks the same list as the forward loop.
Found by LLM-assisted static analysis. Compile-tested on x86_64 with
CONFIG_MLXSW_SPECTRUM=m; no hardware test.
Fixes: a6f43b1dad80 ("mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()")
Signed-off-by: Ziheng Wei <zihengw03@163.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index de60b698b..e54a4ec75 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -787,7 +787,7 @@ mlxsw_sp_bridge_vlans_flood_set(struct mlxsw_sp_bridge_vlan *bridge_vlan,
err_fid_flood_set:
list_for_each_entry_continue_reverse(mlxsw_sp_port_vlan,
&bridge_vlan->port_vlan_list,
- list) {
+ bridge_vlan_node) {
u16 local_port = mlxsw_sp_port_vlan->mlxsw_sp_port->local_port;
mlxsw_sp_fid_flood_set(mlxsw_sp_port_vlan->fid, packet_type,
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
2026-11-30 10:32 [PATCH net] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback Ziheng Wei
@ 2026-11-30 11:22 ` Petr Machata
2026-11-30 13:41 ` Ziheng Wei
0 siblings, 1 reply; 3+ messages in thread
From: Petr Machata @ 2026-11-30 11:22 UTC (permalink / raw)
To: Ziheng Wei
Cc: Ido Schimmel, Petr Machata, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Ziheng Wei <zihengw03@163.com> writes:
> mlxsw_sp_bridge_vlans_flood_set() inserts and walks entries on
> bridge_vlan->port_vlan_list via mlxsw_sp_port_vlan->bridge_vlan_node,
> but its err_fid_flood_set rollback path instead uses the list member in
> list_for_each_entry_continue_reverse().
>
> Use bridge_vlan_node so rollback computes the proper container address
> and walks the same list as the forward loop.
>
> Found by LLM-assisted static analysis. Compile-tested on x86_64 with
> CONFIG_MLXSW_SPECTRUM=m; no hardware test.
>
> Fixes: a6f43b1dad80 ("mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()")
> Signed-off-by: Ziheng Wei <zihengw03@163.com>
Thanks for the patch! The issue is no regression though. The commit this
is patching (itself a fix of a previously-erroneous behavior) introduced
no regression. Previously, not even the forward loop was done, much less
the rollback. Therefore please resend for net-next.
Reviewed-by: Petr Machata <petrm@nvidia.com>
pw-bot: rejected
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
2026-11-30 11:22 ` Petr Machata
@ 2026-11-30 13:41 ` Ziheng Wei
0 siblings, 0 replies; 3+ messages in thread
From: Ziheng Wei @ 2026-11-30 13:41 UTC (permalink / raw)
To: Petr Machata
Cc: Ido Schimmel, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
On Mon, Nov 30, 2026 at 12:22 +0100, Petr Machata wrote:
> Thanks for the patch! The issue is no regression though. The commit this
> is patching (itself a fix of a previously-erroneous behavior) introduced
> no regression. Previously, not even the forward loop was done, much less
> the rollback. Therefore please resend for net-next.
>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
Thanks for the review and explanation, Petr! I will drop the Fixes tag,
add your Reviewed-by, and resend the patch targeting net-next after the
24-hour cooldown.
Best regards,
Ziheng
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-30 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 10:32 [PATCH net] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback Ziheng Wei
2026-11-30 11:22 ` Petr Machata
2026-11-30 13:41 ` Ziheng Wei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®