From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFE3FA0540 for ; Mon, 12 Dec 2022 09:05:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9A1341141; Mon, 12 Dec 2022 09:05:52 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 4733440687; Mon, 12 Dec 2022 09:05:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670832350; x=1702368350; h=from:to:cc:subject:date:message-id; bh=s6UN9YqRSgAoqtrplwGaZotDQBky7YAUyaHVWcweLyE=; b=Cj/v07yNL/emu0fUwpyJWsx/fWEEwA7R1lcSqBQo/682+3LS8DcEPlsT 5D0docgO73HVrpOiw7sr/K9KW8/R40NssdSWCaBDsfDNNmA1E8+snryfz ytJFvm8cGdhP0jMvGOrUodqvUBT9t723ovAHTGpCtn91Df99IzEufi4UL IE2K3k9glwPgHNj5eY0FUVB41AV3//tPgrWIIZVY590st5CdtV2UYDUpL ZVmOP61ScAQR5SxBWBPuN0j1HK8Vupalx8iXfgulJvDjW/gXoxCv1HKS1 itHRMsCsBbCbai6jv8Z4g/OcuRHuEsw9WBAduG3GFxKOdCNHUK64NVtIb A==; X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="318937067" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="318937067" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 00:05:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="680595073" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="680595073" Received: from dpdk-dipei.sh.intel.com ([10.67.110.251]) by orsmga001.jf.intel.com with ESMTP; 12 Dec 2022 00:05:40 -0800 From: Andy Pei 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 Message-Id: <1670829165-138835-1-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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