From patchwork Tue Dec 13 07:37:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pei, Andy" X-Patchwork-Id: 120805 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4223AA0540; Tue, 13 Dec 2022 09:30:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6AB84021D; Tue, 13 Dec 2022 09:30:42 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B106C40146 for ; Tue, 13 Dec 2022 09:30:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670920241; x=1702456241; h=from:to:cc:subject:date:message-id; bh=nQ49JtHQl5FTgycHyeO3v7PyxBTEZZADvSFqfr/fg00=; b=HQg4GCKhfsMYtQIyhLZ8ptAsSiciBxa5uCPL/7zoauGMVSRJ8usgt9XK Y7Lk2tGqK5zA3MRxuNNhVncI3p9NL1P+5AQPLMQ19ZWhJBXY0sVjrS6db nC8H9KGPoHgpBk4FLPB7ZWJLY4YB3gOTZKgsNgdI6GcAjNNldn3QLEV+w h4pK4QcpI5jE0ntqCQSq/bzcTmFKmYKhhpu+B2O6kOpwf15Qc7r9Q1YLh 2/nzck0p2pKHvIQYu9Nfk13TBPZIAOl2+nirl55dYcUqOGMzEWUJFrEM9 aPUlFcCVSdfyq0GLRU542NDolbDn+qF4ReQfonzuQ5sprQYBvVZv10+Zl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="380282240" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="380282240" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 00:30:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="681003895" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="681003895" Received: from dpdk-dipei.sh.intel.com ([10.67.110.251]) by orsmga001.jf.intel.com with ESMTP; 13 Dec 2022 00:30:38 -0800 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com Subject: [PATCH] vdpa/ifc: improve device stop logic for block device Date: Tue, 13 Dec 2022 15:37:35 +0800 Message-Id: <1670917055-229334-1-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For block device, we make sure no IO is inflight before we stop device. We terminate the notify relay process and wait for all inflight IOs to be completed. So in this period, we wait for hardware to update used index, there is no need to relay new kick. Signed-off-by: Andy Pei Reviewed-by: Maxime Coquelin --- drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 49d68ad..0822f47 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -367,11 +367,7 @@ struct rte_vdpa_dev_info { (u16)(ring_state & IFCVF_16_BIT_MASK); hw->vring[i].last_used_idx = (u16)(ring_state >> 16); - if (hw->vring[i].last_avail_idx != - hw->vring[i].last_used_idx) { - ifcvf_notify_queue(hw, i); - usleep(10); - } + usleep(10); } while (hw->vring[i].last_avail_idx != hw->vring[i].last_used_idx); }