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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:49 +0000 (23:28 +0100)
commitf5430661f2f718e36181e47e4b15654b615d9d39
tree91340017d021700916d8a9c4e3bbb631d71b4c8f
parentf24b493eba502547cabd246d119dcc664464ae65
net/mlx5e: Revert parameters on errors when changing MTU and LRO state without reset

[ Upstream commit 8355060f5ec381abda77659f91f56302203df535 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c