summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
diff options
context:
space:
mode:
authorIdo Schimmel2016-06-20 23:04:19 +0200
committerDavid S. Miller2016-06-21 11:02:51 +0200
commitfe3f6d144a843c9845d2eccb78fe72d1bebae0e9 (patch)
tree5fbac0a6879afd08bded7cd3fad9e4469d44a32f /drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
parentmlxsw: spectrum: Don't count on FID being present (diff)
downloadkernel-qcow2-linux-fe3f6d144a843c9845d2eccb78fe72d1bebae0e9.tar.gz
kernel-qcow2-linux-fe3f6d144a843c9845d2eccb78fe72d1bebae0e9.tar.xz
kernel-qcow2-linux-fe3f6d144a843c9845d2eccb78fe72d1bebae0e9.zip
mlxsw: spectrum: Refactor FDB flushing logic
FDB entries are learned using {Port / LAG ID, FID} and therefore should be flushed whenever a port (vPort) leaves its FID (vFID). However, when the bridge port is a LAG device (or a VLAN device on top), then FDB flushing is conditional. Ports removed from such LAG configurations must not trigger flushing, as other ports might still be members in the LAG and therefore the bridge port is still active. The decision whether to flush or not was previously computed in the netdevice notification block, but in order to flush the entries when a port leaves its FID this decision should be computed there. Strip the notification block from this logic and instead move it to one FDB flushing function that is invoked from both the FID / vFID leave functions. When port isn't member in LAG, FDB flushing should always occur. Otherwise, it should occur only when the last port (vPort) member in the LAG leaves the FID (vFID). This will allow us - in the next patch - to simplify the cleanup code paths that are hit whenever the topology above the port netdevs changes. 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/spectrum_switchdev.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index fc34c4691f81..7c2b0f85454d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -500,6 +500,8 @@ static void __mlxsw_sp_port_fid_leave(struct mlxsw_sp_port *mlxsw_sp_port,
if (WARN_ON(!f))
return;
+ mlxsw_sp_port_fdb_flush(mlxsw_sp_port, fid);
+
if (--f->ref_count == 0)
mlxsw_sp_fid_destroy(mlxsw_sp_port->mlxsw_sp, f);
}