]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix error path of device attach
authorAya Levin <ayal@mellanox.com>
Wed, 1 Jul 2020 09:21:53 +0000 (12:21 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 28 Jul 2020 19:55:35 +0000 (12:55 -0700)
commit41ca90a02cde991464abded99da54c831041608e
treee815266021c95067bc24d7abe9135c53ddaad37e
parenta782ff6cad0fc10901cc5b61c49b5dbf48ca0cb3
net/mlx5e: Fix error path of device attach

On failure to attach the netdev, fix the rollback by re-setting the
device's state back to MLX5E_STATE_DESTROYING.

Failing to attach doesn't stop statistics polling via .ndo_get_stats64.
In this case, although the device is not attached, it falsely continues
to query the firmware for counters. Setting the device's state back to
MLX5E_STATE_DESTROYING prevents the firmware counters query.

Fixes: 5d1e89927d7c ("net/mlx5e: Implement mlx5e interface attach/detach callbacks")
Signed-off-by: Aya Levin <ayal@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