]> git.baikalelectronics.ru Git - 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)
commitf5f85873accbed641830ecd3b63dbcfbf3bcb337
tree1dc7ff50d2fd31bddaba1702c423983d05d9ebe1
parent05ae54179db9ef55c942b2f4dcff1de056e5864c
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