net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Fri, 11 Dec 2020 14:05:01 +0000 (16:05 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 26 Jan 2021 23:39:01 +0000 (15:39 -0800)
commit8355060f5ec381abda77659f91f56302203df535
tree57cec9897cb9d9a28fcc43e872764608e8ff12d1
parent912c9b5fcca1ab65b806c19dd3b3cb12d73c6fe2
net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset

Sometimes, channel params are changed without recreating the channels.
It happens in two basic cases: when the channels are closed, and when
the parameter being changed doesn't affect how channels are configured.
Such changes invoke a hardware command that might fail. The whole
operation should be reverted in such cases, but the code that restores
the parameters' values in the driver was missing. This commit adds this
handling.

Fixes: 2e20a151205b ("net/mlx5e: Fail safe mtu and lro setting")
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_main.c