net/mlx5e: Unregister eth-reps devices first
authorRoi Dayan <roid@nvidia.com>
Thu, 14 Jan 2021 14:05:56 +0000 (16:05 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 16 Mar 2021 23:48:42 +0000 (16:48 -0700)
commitfec2b4bb39d961e5a804c34b7184e2cbbb2d7c2c
tree83b202798dff591ff05f68c39b57c5550e6af3f2
parentc27971d08abecc91f06214dacc66ce3ce2662a44
net/mlx5e: Unregister eth-reps devices first

When we clean all the interfaces, i.e. rescan or reload module,
we need to clean eth-reps devices first, before eth devices.

We will re-use the native NIC port net device instance for the Uplink
representor. Changing eswitch mode will skip destroying the eth device
so the net device won't be destroyed and only change the profile.

Creating uplink eth-rep will initialize the representor related resources.
In that sense when we destroy all devices we first need to destroy
eth-rep devices so uplink eth-rep will clean all representor related
resources and only then destroy the eth device which will destroy rest
of the resources and the net device.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c