net/mlx5e: Use mlx5e_safe_switch_channels when channels are closed
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Thu, 28 Jan 2021 13:36:21 +0000 (15:36 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Apr 2021 18:48:14 +0000 (11:48 -0700)
commit69cc4185dcbaaedc52d5d8d13b4aac2a3836a874
treecb8dc280e9afbcc31819d8228642d8dde418f64e
parent6cad120d9e621a4eeff1d45dca41416a1e0b77d5
net/mlx5e: Use mlx5e_safe_switch_channels when channels are closed

This commit uses new functionality of mlx5e_safe_switch_channels
introduced by the previous commit to reduce the amount of repeating
similar code all over the driver.

It's very common in mlx5e to call mlx5e_safe_switch_channels when the
channels are open, but assign parameters and run hardware commands
manually when the channels are closed.

After the previous commit it's no longer needed to do such manual things
every time, so this commit removes unneeded code and relies on the new
functionality of mlx5e_safe_switch_channels. Some of the places are
refactored and simplified, where more complex flows are used to change
configuration on the fly, without recreating the channels (the logic is
rewritten in a more robust way, with a reset required by default and a
list of exceptions).

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c