From: Longfang Liu <liulongfang@huawei.com>
To: <alex.williamson@redhat.com>, <jgg@nvidia.com>,
<jonathan.cameron@huawei.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<liulongfang@huawei.com>
Subject: [PATCH v2 4/4] hisi_acc_vfio_pci: fix the queue parameter anomaly issue
Date: Thu, 22 Jan 2026 10:02:05 +0800 [thread overview]
Message-ID: <20260122020205.2884497-5-liulongfang@huawei.com> (raw)
In-Reply-To: <20260122020205.2884497-1-liulongfang@huawei.com>
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>
---
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
index 483381189579..e61df3fe0db9 100644
--- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
+++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
@@ -426,7 +426,7 @@ static int vf_qm_check_match(struct hisi_acc_vf_core_device *hisi_acc_vdev,
ret = qm_get_vft(vf_qm, &vf_qm->qp_base);
if (ret <= 0) {
dev_err(dev, "failed to get vft qp nums\n");
- return ret;
+ return ret < 0 ? ret : -EINVAL;
}
if (ret != vf_data->qp_num) {
--
2.33.0
next prev parent reply other threads:[~2026-01-22 2:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 2:02 [PATCH v2 0/4] bugfix some issues under abnormal scenarios Longfang Liu
2026-01-22 2:02 ` [PATCH v2 1/4] hisi_acc_vfio_pci: fix VF reset timeout issue Longfang Liu
2026-01-22 2:02 ` [PATCH v2 2/4] hisi_acc_vfio_pci: update status after RAS error Longfang Liu
2026-01-22 2:02 ` [PATCH v2 3/4] hisi_acc_vfio_pci: resolve duplicate migration states Longfang Liu
2026-01-22 2:02 ` Longfang Liu [this message]
2026-01-29 21:58 ` [PATCH v2 0/4] bugfix some issues under abnormal scenarios Alex Williamson
2026-01-30 2:08 ` liulongfang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260122020205.2884497-5-liulongfang@huawei.com \
--to=liulongfang@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=jgg@nvidia.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®