]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/mlx5: DR, Fix the SMFS sync_steering for fast teardown
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Sun, 24 Jul 2022 21:59:44 +0000 (00:59 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 27 Oct 2022 14:50:37 +0000 (15:50 +0100)
If sync happens when the device is in fast teardown, just bail
and don't do anything, because the PCI device is not there any more.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c

index 16d65fe4f654ac7bb035b3afc8ce0fc736470261..b4739eafc180f9aa9921c86d13bcd52b2cb75c0a 100644 (file)
@@ -271,6 +271,13 @@ int mlx5dr_cmd_sync_steering(struct mlx5_core_dev *mdev)
 {
        u32 in[MLX5_ST_SZ_DW(sync_steering_in)] = {};
 
+       /* Skip SYNC in case the device is internal error state.
+        * Besides a device error, this also happens when we're
+        * in fast teardown
+        */
+       if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
+               return 0;
+
        MLX5_SET(sync_steering_in, in, opcode, MLX5_CMD_OP_SYNC_STEERING);
 
        return mlx5_cmd_exec_in(mdev, sync_steering, in);