]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Allow mlx5e_switch_priv_channels to fail and recover
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Wed, 13 Nov 2019 16:07:29 +0000 (18:07 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 26 Feb 2020 01:05:59 +0000 (17:05 -0800)
commitc7805218e27b3be5c899808728d83f6e69c79a3e
treed209d4926c4085c4948e23cb6fd0f7d7885fee30
parent8641c7840bd979fd3530d79c2a2a1689ef1637c4
net/mlx5e: Allow mlx5e_switch_priv_channels to fail and recover

Currently mlx5e_switch_priv_channels expects that the preactivate hook
doesn't fail, however, it can fail, because it may set hardware
parameters. This commit addresses this issue and provides a way to
recover from failures of the preactivate hook: the old channels are not
closed until the point where nothing can fail anymore, so in case
preactivate fails, the driver can roll back the old channels and
activate them again.

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