DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andy Pei <andy.pei@intel.com>
To: dev@dpdk.org
Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com,
	xiao.w.wang@intel.com, stable@dpdk.org
Subject: [PATCH] vdpa/ifc: fix reconnetion issue in SW assisted live migration
Date: Mon, 12 Dec 2022 15:12:45 +0800	[thread overview]
Message-ID: <1670829165-138835-1-git-send-email-andy.pei@intel.com> (raw)

In the case using argument "sw-live-migration=1" to enable SW assisted live 
migration, we take QEMU as front end for example, after source VM migrates 
to destination VM, we keep vdpa process for source VM there, we kill the 
QEMU process for source VM, and restart the QEMU process for source VM. 
In this case, vdpa driver will not perform DMA map and data path will not 
work properly.

The above case works fine in the case "sw-live-migration=0".

The root cause is that current code driver does not set running flag to 0.
Driver treats device as ruuning and does not perform DMA map.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 49d68ad..dc8600d 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1044,6 +1044,8 @@ struct rte_vdpa_dev_info {
 
 	vdpa_disable_vfio_intr(internal);
 
+	rte_atomic32_set(&internal->running, 0);
+
 	ret = rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, false);
 	if (ret && ret != -ENOTSUP)
 		goto error;
-- 
1.8.3.1


             reply	other threads:[~2022-12-12  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  7:12 Andy Pei [this message]
2023-01-19 14:51 ` Maxime Coquelin
2023-02-03 14:51 ` Maxime Coquelin

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=1670829165-138835-1-git-send-email-andy.pei@intel.com \
    --to=andy.pei@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=xiao.w.wang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).