netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] mlxsw: spectrum: Disable MAC learning for ovs port
@ 2017-12-15 13:26 Jiri Pirko
  2017-12-15 17:11 ` Jiri Pirko
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2017-12-15 13:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, yuvalm, idosch, mlxsw

From: Yuval Mintz <yuvalm@mellanox.com>

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")
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 2d0897b..9bd8d28 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -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);
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch net] mlxsw: spectrum: Disable MAC learning for ovs port
  2017-12-15 13:26 [patch net] mlxsw: spectrum: Disable MAC learning for ovs port Jiri Pirko
@ 2017-12-15 17:11 ` Jiri Pirko
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-12-15 17:11 UTC (permalink / raw)
  To: netdev; +Cc: davem, yuvalm, idosch, mlxsw

Fri, Dec 15, 2017 at 02:26:58PM CET, jiri@resnulli.us wrote:
>From: Yuval Mintz <yuvalm@mellanox.com>
>
>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")
>Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
>Reviewed-by: Ido Schimmel <idosch@mellanox.com>
>Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Oh, I sent this one twice. Sorry :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch net] mlxsw: spectrum: Disable MAC learning for ovs port
  2017-12-15  7:44 Jiri Pirko
@ 2017-12-15 15:48 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-12-15 15:48 UTC (permalink / raw)
  To: jiri; +Cc: netdev, yuvalm, idosch, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 15 Dec 2017 08:44:21 +0100

> From: Yuval Mintz <yuvalm@mellanox.com>
> 
> 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")
> Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
> Reviewed-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch net] mlxsw: spectrum: Disable MAC learning for ovs port
@ 2017-12-15  7:44 Jiri Pirko
  2017-12-15 15:48 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2017-12-15  7:44 UTC (permalink / raw)
  To: netdev; +Cc: davem, yuvalm, idosch, mlxsw

From: Yuval Mintz <yuvalm@mellanox.com>

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")
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 2d0897b..9bd8d28 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -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);
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-15 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-15 13:26 [patch net] mlxsw: spectrum: Disable MAC learning for ovs port Jiri Pirko
2017-12-15 17:11 ` Jiri Pirko
  -- strict thread matches above, loose matches on Subject: below --
2017-12-15  7:44 Jiri Pirko
2017-12-15 15:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).