Skip to content

Commit

Permalink
net/mlx5e: Unregister eth-reps devices first
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roi Dayan authored and Saeed Mahameed committed Mar 16, 2021
1 parent c27971d commit fec2b4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5900,18 +5900,18 @@ int mlx5e_init(void)

mlx5e_ipsec_build_inverse_table();
mlx5e_build_ptys2ethtool_map();
ret = mlx5e_rep_init();
ret = auxiliary_driver_register(&mlx5e_driver);
if (ret)
return ret;

ret = auxiliary_driver_register(&mlx5e_driver);
ret = mlx5e_rep_init();
if (ret)
mlx5e_rep_cleanup();
auxiliary_driver_unregister(&mlx5e_driver);
return ret;
}

void mlx5e_cleanup(void)
{
auxiliary_driver_unregister(&mlx5e_driver);
mlx5e_rep_cleanup();
auxiliary_driver_unregister(&mlx5e_driver);
}

0 comments on commit fec2b4b

Please sign in to comment.