Skip to content

Commit fec2b4b

Browse files
roidayanSaeed Mahameed
authored andcommitted
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 <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent c27971d commit fec2b4b

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5900,18 +5900,18 @@ int mlx5e_init(void)
59005900

59015901
mlx5e_ipsec_build_inverse_table();
59025902
mlx5e_build_ptys2ethtool_map();
5903-
ret = mlx5e_rep_init();
5903+
ret = auxiliary_driver_register(&mlx5e_driver);
59045904
if (ret)
59055905
return ret;
59065906

5907-
ret = auxiliary_driver_register(&mlx5e_driver);
5907+
ret = mlx5e_rep_init();
59085908
if (ret)
5909-
mlx5e_rep_cleanup();
5909+
auxiliary_driver_unregister(&mlx5e_driver);
59105910
return ret;
59115911
}
59125912

59135913
void mlx5e_cleanup(void)
59145914
{
5915-
auxiliary_driver_unregister(&mlx5e_driver);
59165915
mlx5e_rep_cleanup();
5916+
auxiliary_driver_unregister(&mlx5e_driver);
59175917
}

0 commit comments

Comments
 (0)