Skip to contentSkip to conversation

mlxsw: spectrum: Disable MAC learning for ovs port

PATCH In review Jiri Pirko 1 participant 2 messages Dec 15, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 mlxsw: spectrum: Disable MAC learning for ovs port

From: Yuval Mintz <[email protected]>

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 2b94e58df58c ("mlxsw: spectrum: Allow ports to work under OVS master")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +18 -0
index 2d0897b..9bd8d28 100644
@@ -4300,6 +4300,7 @@ static int mlxsw_sp_port_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
 
 static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
 {
+	u16 vid = 1;
 	int err;
 
 	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)
 				     true, false);
 	if (err)
 		goto err_port_vlan_set;
+
+	for (; vid <= VLAN_N_VID - 1; vid++) {
+		err = mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
+						     vid, false);
+		if (err)
+			goto err_vid_learning_set;
+	}
+
 	return 0;
 
+err_vid_learning_set:
+	for (vid--; vid >= 1; vid--)
+		mlxsw_sp_port_vid_learning_set(mlxsw_sp_port, vid, true);
 err_port_vlan_set:
 	mlxsw_sp_port_stp_set(mlxsw_sp_port, false);
 err_port_stp_set:
@@ -4323,6 +4335,12 @@ static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
 
 static void mlxsw_sp_port_ovs_leave(struct mlxsw_sp_port *mlxsw_sp_port)
 {
+	u16 vid;
+
+	for (vid = VLAN_N_VID - 1; vid >= 1; vid--)
+		mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
+					       vid, true);
+
 	mlxsw_sp_port_vlan_set(mlxsw_sp_port, 2, VLAN_N_VID - 1,
 			       false, false);
 	mlxsw_sp_port_stp_set(mlxsw_sp_port, false);
Signature · 1 line
2.9.5
author
#1 lore raw
Quoted 11 lines · Fri, Dec 15, 2017 at 02:26:58PM CET, [email protected] wrote:

From: Yuval Mintz <[email protected]>

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 2b94e58df58c ("mlxsw: spectrum: Allow ports to work under OVS master")

Oh, I sent this one twice. Sorry :)