OSDN Git Service

net/mlx5e: Revert parameters on errors when changing trust state without reset
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Thu, 14 Jan 2021 10:34:01 +0000 (12:34 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 26 Jan 2021 23:38:58 +0000 (15:38 -0800)
commit912c9b5fcca1ab65b806c19dd3b3cb12d73c6fe2
tree7c32f3b4e0480258f7b163538bd325d364fc15e2
parent57ac4a31c48377a3e675b2a731ceacbefefcd34d
net/mlx5e: Revert parameters on errors when changing trust state without reset

Trust state may be changed without recreating the channels. It happens
when the channels are closed, and when channel parameters (min inline
mode) stay the same after changing the trust state. Changing the trust
state is a hardware command that may fail. The current code didn't
restore the channel parameters to their old values if an error happened
and the channels were closed. This commit adds handling for this case.

Fixes: 6e0504c69811 ("net/mlx5e: Change inline mode correctly when changing trust state")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c