mlx5: Do not poke hardware for statistic after teardown is started.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
This commit is contained in:
kib 2019-12-05 15:21:13 +00:00
parent 9159d4fe20
commit 72af986714
3 changed files with 7 additions and 3 deletions

View File

@ -640,7 +640,8 @@ enum mlx5_device_state {
};
enum mlx5_interface_state {
MLX5_INTERFACE_STATE_UP,
MLX5_INTERFACE_STATE_UP = 0x1,
MLX5_INTERFACE_STATE_TEARDOWN = 0x2,
};
enum mlx5_pci_status {

View File

@ -1606,6 +1606,8 @@ static void shutdown_one(struct pci_dev *pdev)
/* enter polling mode */
mlx5_cmd_use_polling(dev);
set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state);
/* disable all interrupts */
mlx5_disable_interrupts(dev);

View File

@ -1038,9 +1038,10 @@ mlx5e_update_stats_work(struct work_struct *work)
{
struct mlx5e_priv *priv;
priv = container_of(work, struct mlx5e_priv, update_stats_work);
priv = container_of(work, struct mlx5e_priv, update_stats_work);
PRIV_LOCK(priv);
if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0)
if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 &&
!test_bit(MLX5_INTERFACE_STATE_TEARDOWN, &priv->mdev->intf_state))
mlx5e_update_stats_locked(priv);
PRIV_UNLOCK(priv);
}