diff mbox series

[SRU,F,1/1] net/mlx5: Fix HW spec violation configuring uplink

Message ID 20210427071343.2072851-2-frank.heimes@canonical.com
State New
Headers show
Series [SRU,F,1/1] net/mlx5: Fix HW spec violation configuring uplink | expand

Commit Message

Frank Heimes April 27, 2021, 7:13 a.m. UTC
From: Eli Cohen <elic@nvidia.com>

BugLink: https://bugs.launchpad.net/bugs/1925452

Make sure to modify uplink port to follow only if the uplink_follow
capability is set as required by the HW spec. Failure to do so causes
traffic to the uplink representor net device to cease after switching to
switchdev mode.

Fixes: 7d0314b11cdd ("net/mlx5e: Modify uplink state on interface up/down")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reported-and-Tested-by: Alexander Schmidt <alexschm@de.ibm.com>
(backported from commit 1a73704c82ed4ee95532ac04645d02075bd1ce3d)
Signed-off-by: Alexander Schmidt <alexschm@de.ibm.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: Frank Heimes <frank.heimes@canonical.com> 
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 88b51f64a64e..35246535eb5a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1736,8 +1736,9 @@  static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)
 	INIT_WORK(&rpriv->uplink_priv.reoffload_flows_work,
 		  mlx5e_tc_reoffload_flows_work);
 
-	mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
-				      0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
+	if (MLX5_CAP_GEN(mdev, uplink_follow))
+		mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
+					      0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
 	mlx5_lag_add(mdev, netdev);
 	priv->events_nb.notifier_call = uplink_rep_async_event;
 	mlx5_notifier_register(mdev, &priv->events_nb);