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 DBE98A00BE; Mon, 16 May 2022 06:20:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B909A40A7A; Mon, 16 May 2022 06:20:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 17D4040A79 for ; Mon, 16 May 2022 06:20:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652674831; x=1684210831; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=R6YB32YCeWFI74Pk9uz4XvTCvyIjvRFj5uFKg5Ne5Y8=; b=SGuuwB74Jl+oiqosgWZpDU7GDsAid5bAOZZLrtTWbcsW8QcK8t4Vs5NS e+Sixzll1gcQw8nkFMiiU6LlErsC7qh8E5DcXmrapMAlRGMWra6Ye9LLb JxF6SQI2XAntKBig7qxnNLkXd9MYDsMOWVHEesI6VO1+Iab5e6CqFpwtD SjFgqnBTg7FBT9rqOrdULG/2OadkYHveFcYfP48Is4t/fRsqCWVzlG9VC Ty0YFWQuiiaoPnjKXJtvvF8LmSCBqDvvzgcPoStyP23mg9DupcoW5SKcH kfYSoiN/Ckg73oRyP0z9lDs6K/q491kodIepbe0kwDNsaoUiIcXGTZGdP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="252796396" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="252796396" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2022 21:20:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="544169520" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga006.jf.intel.com with ESMTP; 15 May 2022 21:20:28 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 15 May 2022 21:20:27 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 15 May 2022 21:20:27 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Sun, 15 May 2022 21:20:27 -0700 From: "Pei, Andy" To: "Xia, Chenbo" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" Subject: RE: [PATCH v7 17/18] vdpa/ifc: blk device pause without no inflight IO Thread-Topic: [PATCH v7 17/18] vdpa/ifc: blk device pause without no inflight IO Thread-Index: AQHYWheNuKQF5t+hiEGbU8LTESsNfK0cNnwQgATNu6A= Date: Mon, 16 May 2022 04:20:27 +0000 Message-ID: <76b996b739ac431a8adff584d5c3949d@intel.com> References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1651048206-282372-1-git-send-email-andy.pei@intel.com> <1651048206-282372-18-git-send-email-andy.pei@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.401.20 dlp-reaction: no-action x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 Hi Chenbo, Thanks for reply. This will be addressed in next version. > -----Original Message----- > From: Xia, Chenbo > Sent: Friday, May 13, 2022 10:59 AM > To: Pei, Andy ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng > Subject: RE: [PATCH v7 17/18] vdpa/ifc: blk device pause without no infli= ght > IO >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Wednesday, April 27, 2022 4:30 PM > > To: dev@dpdk.org > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > Cao, Gang ; Liu, Changpeng > > > > Subject: [PATCH v7 17/18] vdpa/ifc: blk device pause without no > > inflight IO > > > > When virtio blk device is pause, make sure hardware last_avail_idx and > > last_used_idx are the same. >=20 > Patch is good. But illustrate more on avoiding in-flight packet in commit= log >=20 > Thanks, > Chenbo >=20 > > > > Signed-off-by: Andy Pei > > --- > > drivers/vdpa/ifc/ifcvf_vdpa.c | 25 +++++++++++++++++-------- > > 1 file changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c > > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 4923bc1..def6adf 100644 > > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > > @@ -314,12 +314,12 @@ struct rte_vdpa_dev_info { > > vdpa_ifcvf_stop(struct ifcvf_internal *internal) { > > struct ifcvf_hw *hw =3D &internal->hw; > > - struct rte_vhost_vring vq; > > uint32_t i; > > int vid; > > uint64_t features =3D 0; > > uint64_t log_base =3D 0, log_size =3D 0; > > uint64_t len; > > + u32 ring_state =3D 0; > > > > vid =3D internal->vid; > > > > @@ -328,13 +328,22 @@ struct rte_vdpa_dev_info { > > */ > > if (internal->device_type =3D=3D IFCVF_BLK) { > > for (i =3D 0; i < hw->nr_vring; i++) { > > - rte_vhost_get_vhost_vring(internal->vid, i, &vq); > > - while (vq.avail->idx !=3D vq.used->idx) { > > - ifcvf_notify_queue(hw, i); > > - usleep(10); > > - } > > - hw->vring[i].last_avail_idx =3D vq.avail->idx; > > - hw->vring[i].last_used_idx =3D vq.used->idx; > > + do { > > + if (hw->lm_cfg !=3D NULL) > > + ring_state =3D *(u32 *)(hw->lm_cfg + > > + > IFCVF_LM_RING_STATE_OFFSET + > > + i * IFCVF_LM_CFG_SIZE); > > + hw->vring[i].last_avail_idx =3D > > + (u16)(ring_state & > IFCVF_16_BIT_MASK); > > + hw->vring[i].last_used_idx =3D > > + (u16)(ring_state >> 16); > > + if (hw->vring[i].last_avail_idx !=3D > > + hw->vring[i].last_used_idx) { > > + ifcvf_notify_queue(hw, i); > > + usleep(10); > > + } > > + } while (hw->vring[i].last_avail_idx !=3D > > + hw->vring[i].last_used_idx); > > } > > } > > > > -- > > 1.8.3.1 >=20