Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e1e93c7 authored by Mohamad Haj Yahia's avatar Mohamad Haj Yahia Committed by David S. Miller
Browse files

net/mlx5e: Unregister netdev before detaching it



Detaching the netdev before unregistering it cause some netdev cleanup
ndos to fail because they check presence of the netdev, so we need to
unregister the netdev first.

Fixes: 26e59d80 ('net/mlx5e: Implement mlx5e interface attach/detach callbacks')
Signed-off-by: default avatarMohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b029556
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4048,7 +4048,6 @@ void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv)
	const struct mlx5e_profile *profile = priv->profile;
	struct net_device *netdev = priv->netdev;

	unregister_netdev(netdev);
	destroy_workqueue(priv->wq);
	if (profile->cleanup)
		profile->cleanup(priv);
@@ -4065,6 +4064,7 @@ static void mlx5e_remove(struct mlx5_core_dev *mdev, void *vpriv)
	for (vport = 1; vport < total_vfs; vport++)
		mlx5_eswitch_unregister_vport_rep(esw, vport);

	unregister_netdev(priv->netdev);
	mlx5e_detach(mdev, vpriv);
	mlx5e_destroy_netdev(mdev, priv);
}
+1 −0
Original line number Diff line number Diff line
@@ -457,6 +457,7 @@ void mlx5e_vport_rep_unload(struct mlx5_eswitch *esw,
	struct mlx5e_priv *priv = rep->priv_data;
	struct net_device *netdev = priv->netdev;

	unregister_netdev(netdev);
	mlx5e_detach_netdev(esw->dev, netdev);
	mlx5e_destroy_netdev(esw->dev, priv);
}