[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1456242694-29463-9-git-send-email-jiri@resnulli.us>
Date: Tue, 23 Feb 2016 16:51:33 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, idosch@...lanox.com, eladr@...lanox.com,
yotamg@...lanox.com, ogerlitz@...lanox.com, yishaih@...lanox.com,
dledford@...hat.com, sean.hefty@...el.com,
hal.rosenstock@...il.com, eugenia@...lanox.com,
roopa@...ulusnetworks.com, nikolay@...ulusnetworks.com,
hadarh@...lanox.com, jhs@...atatu.com, john.fastabend@...il.com,
jeffrey.t.kirsher@...el.com, brouer@...hat.com, ivecera@...hat.com,
rami.rosen@...el.com, hannes@...essinduktion.org,
gospo@...ulusnetworks.com
Subject: [patch net-next v2 8/9] mlxsw: spectrum: Mark unused ports using NULL
From: Ido Schimmel <idosch@...lanox.com>
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@...lanox.com>
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 240881c..926019e 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 */
--
2.5.0
Powered by blists - more mailing lists