Skip to content

Commit a133318

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum: Mark unused ports using NULL
When splitting and unsplitting we'll destroy usable ports on the fly, so mark them using a NULL pointer to indicate that their local port number is free and can be re-used. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 558c2d5 commit a133318

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,7 @@ static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port)
15181518

15191519
if (!mlxsw_sp_port)
15201520
return;
1521+
mlxsw_sp->ports[local_port] = NULL;
15211522
devlink_port = &mlxsw_sp_port->devlink_port;
15221523
devlink_port_type_clear(devlink_port);
15231524
unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */

0 commit comments

Comments
 (0)