aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlaa Hleihel <alaa@mellanox.com>2019-05-26 04:56:27 -0400
committerSaeed Mahameed <saeedm@mellanox.com>2019-06-07 17:40:37 -0400
commit47c9d2c99ddeecca61c97618857b70fc7901658b (patch)
tree167a4ccf7b09ed052aa55ef935627db8fc3063ec
parentb83c0730167c7ea6c03bffceefb86ae710ab30e2 (diff)
net/mlx5e: Avoid detaching non-existing netdev under switchdev mode
After introducing dedicated uplink representor, the netdev instance set over the esw manager vport (PF) became no longer in use, so it was removed in the cited commit once we're on switchdev mode. However, the mlx5e_detach function was not updated accordingly, and it still tries to detach a non-existing netdev, causing a kernel crash. This patch fixes this issue. Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode") Signed-off-by: Alaa Hleihel <alaa@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 564692227c16..a8e8350b38aa 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5108,6 +5108,11 @@ static void mlx5e_detach(struct mlx5_core_dev *mdev, void *vpriv)
5108 struct mlx5e_priv *priv = vpriv; 5108 struct mlx5e_priv *priv = vpriv;
5109 struct net_device *netdev = priv->netdev; 5109 struct net_device *netdev = priv->netdev;
5110 5110
5111#ifdef CONFIG_MLX5_ESWITCH
5112 if (MLX5_ESWITCH_MANAGER(mdev) && vpriv == mdev)
5113 return;
5114#endif
5115
5111 if (!netif_device_present(netdev)) 5116 if (!netif_device_present(netdev))
5112 return; 5117 return;
5113 5118