diff options
author | Ido Schimmel <idosch@mellanox.com> | 2016-02-26 17:32:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-01 16:07:30 -0500 |
commit | a133318cde2000a3264032ea3b561c9054613486 (patch) | |
tree | e202e6321602b6e83a618e666a2cbb71a8162dd1 /drivers/net/ethernet/mellanox/mlxsw | |
parent | 558c2d5e52142fc503f79bec89413724cfc37bdd (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 240881c8dec2..926019e86c36 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -1518,6 +1518,7 @@ static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port) if (!mlxsw_sp_port) return; + mlxsw_sp->ports[local_port] = NULL; devlink_port = &mlxsw_sp_port->devlink_port; devlink_port_type_clear(devlink_port); unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */ |