summaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@nvidia.com>2024-02-05 14:48:27 +0200
committerAlex Williamson <alex.williamson@redhat.com>2024-02-22 12:17:32 -0700
commitd8d577b5fa2a8832f5730ac26e905d8ac131882d (patch)
tree6183f8500bec4b359160309fd8af8583de2da8ca /drivers/vfio
parent793d4bfa3103a238c6e48eb13c38fa31acd18b94 (diff)
downloadlinux-d8d577b5fa2a8832f5730ac26e905d8ac131882d.tar.gz
linux-d8d577b5fa2a8832f5730ac26e905d8ac131882d.tar.bz2
linux-d8d577b5fa2a8832f5730ac26e905d8ac131882d.zip
vfio/mlx5: Block incremental query upon migf state error
Block incremental query which is state-dependent once the migration file was previously marked with state error. This may prevent redundant calls to firmware upon PRE_COPY which will end-up with a failure and a syndrome printed in dmesg. Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/r/20240205124828.232701-5-yishaih@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/pci/mlx5/cmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vfio/pci/mlx5/cmd.c b/drivers/vfio/pci/mlx5/cmd.c
index 6b45bd7d89ad..6800e4ffe9ee 100644
--- a/drivers/vfio/pci/mlx5/cmd.c
+++ b/drivers/vfio/pci/mlx5/cmd.c
@@ -121,6 +121,11 @@ int mlx5vf_cmd_query_vhca_migration_state(struct mlx5vf_pci_core_device *mvdev,
}
query_flags &= ~MLX5VF_QUERY_INC;
}
+ /* Block incremental query which is state-dependent */
+ if (mvdev->saving_migf->state == MLX5_MIGF_STATE_ERROR) {
+ complete(&mvdev->saving_migf->save_comp);
+ return -ENODEV;
+ }
}
MLX5_SET(query_vhca_migration_state_in, in, opcode,