Skip to content

Commit fccff08

Browse files
Yuval Mintzdavem330
authored andcommitted
mlxsw: spectrum: Disable MAC learning for ovs port
Learning is currently enabled for ports which are OVS slaves - even though OVS doesn't need this indication. Since we're not associating a fid with the port, HW would continuously notify driver of learned [& aged] MACs which would be logged as errors. Fixes: 2b94e58 ("mlxsw: spectrum: Allow ports to work under OVS master") Signed-off-by: Yuval Mintz <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8c8f67a commit fccff08

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,6 +4300,7 @@ static int mlxsw_sp_port_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
43004300

43014301
static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
43024302
{
4303+
u16 vid = 1;
43034304
int err;
43044305

43054306
err = mlxsw_sp_port_vp_mode_set(mlxsw_sp_port, true);
@@ -4312,8 +4313,19 @@ static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
43124313
true, false);
43134314
if (err)
43144315
goto err_port_vlan_set;
4316+
4317+
for (; vid <= VLAN_N_VID - 1; vid++) {
4318+
err = mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
4319+
vid, false);
4320+
if (err)
4321+
goto err_vid_learning_set;
4322+
}
4323+
43154324
return 0;
43164325

4326+
err_vid_learning_set:
4327+
for (vid--; vid >= 1; vid--)
4328+
mlxsw_sp_port_vid_learning_set(mlxsw_sp_port, vid, true);
43174329
err_port_vlan_set:
43184330
mlxsw_sp_port_stp_set(mlxsw_sp_port, false);
43194331
err_port_stp_set:
@@ -4323,6 +4335,12 @@ static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
43234335

43244336
static void mlxsw_sp_port_ovs_leave(struct mlxsw_sp_port *mlxsw_sp_port)
43254337
{
4338+
u16 vid;
4339+
4340+
for (vid = VLAN_N_VID - 1; vid >= 1; vid--)
4341+
mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
4342+
vid, true);
4343+
43264344
mlxsw_sp_port_vlan_set(mlxsw_sp_port, 2, VLAN_N_VID - 1,
43274345
false, false);
43284346
mlxsw_sp_port_stp_set(mlxsw_sp_port, false);

0 commit comments

Comments
 (0)