mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-17 18:14:34 +08:00
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: aec002f6f8
("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>
This commit is contained in:
parent
b83c073016
commit
47c9d2c99d
@ -5108,6 +5108,11 @@ static void mlx5e_detach(struct mlx5_core_dev *mdev, void *vpriv)
|
||||
struct mlx5e_priv *priv = vpriv;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
|
||||
#ifdef CONFIG_MLX5_ESWITCH
|
||||
if (MLX5_ESWITCH_MANAGER(mdev) && vpriv == mdev)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (!netif_device_present(netdev))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user