Commit 45827d78 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum: Notify bridge's FDB only based on learning_sync

When we disable learning on bridge port we should still update the
software bridge's FDB when entry pointing to this bridge port is
aged-out. We can otherwise have an inconsistency between software and
hardware tables.

Fixes: 8a1ab5d7 ("mlxsw: spectrum: Implement FDB add/remove/dump for LAG")
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45491133
...@@ -1202,14 +1202,14 @@ static const struct switchdev_ops mlxsw_sp_port_switchdev_ops = { ...@@ -1202,14 +1202,14 @@ static const struct switchdev_ops mlxsw_sp_port_switchdev_ops = {
.switchdev_port_obj_dump = mlxsw_sp_port_obj_dump, .switchdev_port_obj_dump = mlxsw_sp_port_obj_dump,
}; };
static void mlxsw_sp_fdb_call_notifiers(bool learning, bool learning_sync, static void mlxsw_sp_fdb_call_notifiers(bool learning_sync, bool adding,
bool adding, char *mac, u16 vid, char *mac, u16 vid,
struct net_device *dev) struct net_device *dev)
{ {
struct switchdev_notifier_fdb_info info; struct switchdev_notifier_fdb_info info;
unsigned long notifier_type; unsigned long notifier_type;
if (learning && learning_sync) { if (learning_sync) {
info.addr = mac; info.addr = mac;
info.vid = vid; info.vid = vid;
notifier_type = adding ? SWITCHDEV_FDB_ADD : SWITCHDEV_FDB_DEL; notifier_type = adding ? SWITCHDEV_FDB_ADD : SWITCHDEV_FDB_DEL;
...@@ -1265,8 +1265,7 @@ static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp, ...@@ -1265,8 +1265,7 @@ static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp,
if (!do_notification) if (!do_notification)
return; return;
mlxsw_sp_fdb_call_notifiers(mlxsw_sp_port->learning, mlxsw_sp_fdb_call_notifiers(mlxsw_sp_port->learning_sync,
mlxsw_sp_port->learning_sync,
adding, mac, vid, mlxsw_sp_port->dev); adding, mac, vid, mlxsw_sp_port->dev);
return; return;
...@@ -1327,9 +1326,8 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp, ...@@ -1327,9 +1326,8 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
if (!do_notification) if (!do_notification)
return; return;
mlxsw_sp_fdb_call_notifiers(mlxsw_sp_port->learning, mlxsw_sp_fdb_call_notifiers(mlxsw_sp_port->learning_sync, adding, mac,
mlxsw_sp_port->learning_sync, vid,
adding, mac, vid,
mlxsw_sp_lag_get(mlxsw_sp, lag_id)->dev); mlxsw_sp_lag_get(mlxsw_sp, lag_id)->dev);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment