Skip to content

Commit c3cbc27

Browse files
Longfang Liuawilliam
authored andcommitted
hisi_acc_vfio_pci: fix the queue parameter anomaly issue
When the number of QPs initialized by the device, as read via vft, is zero, it indicates either an abnormal device configuration or an abnormal read result. Returning 0 directly in this case would allow the live migration operation to complete successfully, leading to incorrect parameter configuration after migration and preventing the service from recovering normal functionality. Therefore, in such situations, an error should be returned to roll back the live migration operation. Signed-off-by: Longfang Liu <liulongfang@huawei.com> Link: https://lore.kernel.org/r/20260122020205.2884497-5-liulongfang@huawei.com Signed-off-by: Alex Williamson <alex@shazbot.org>
1 parent 8c6ac17 commit c3cbc27

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int vf_qm_check_match(struct hisi_acc_vf_core_device *hisi_acc_vdev,
426426
ret = qm_get_vft(vf_qm, &vf_qm->qp_base);
427427
if (ret <= 0) {
428428
dev_err(dev, "failed to get vft qp nums\n");
429-
return ret;
429+
return ret < 0 ? ret : -EINVAL;
430430
}
431431

432432
if (ret != vf_data->qp_num) {

0 commit comments

Comments
 (0)