]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net/mlx5e: Allow mlx5e_safe_switch_channels to work with channels closed
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Wed, 27 Jan 2021 16:28:03 +0000 (18:28 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Apr 2021 18:48:11 +0000 (11:48 -0700)
commit6cad120d9e621a4eeff1d45dca41416a1e0b77d5
tree1dc7ff50d2fd31bddaba1702c423983d05d9ebe1
parente9ce991bce5bacf71641bd0f72f4b7c589529f40
net/mlx5e: Allow mlx5e_safe_switch_channels to work with channels closed

mlx5e_safe_switch_channels is used to modify channel parameters and/or
hardware configuration in a safe way, so that if anything goes wrong,
everything reverts to the old configuration and remains in a consistent
state.

However, this function only works when the channels are open. When the
caller needs to modify some parameters, first it has to check that the
channels are open, otherwise it has to assign parameters directly, and
such boilerplate repeats in many different places.

This commit prepares for the refactoring of such places by allowing
mlx5e_safe_switch_channels to work when the channels are closed. In this
case it will assign the new parameters and run the preactivate hook.

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