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 94A6AA00C3; Fri, 13 May 2022 04:59:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8429340E64; Fri, 13 May 2022 04:59:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id BC05040DDE for ; Fri, 13 May 2022 04:59:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652410753; x=1683946753; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Z1KSERiCQxntausW+b48hjq8spU6IGUSyx8aOHGQ/8g=; b=khmsl66m8Q+vJp+ZqhquDTc8K/TOeBW3EVVazmw0cRfk8MBH48+c4YLm /jqFgOxPc7IZFO83OSL9QWM1JTj3zWk4Xoo85oEdfeBTtK71HdVKyMYNU I+wAbR8YKy8VMIdE47gLKncLKG++g1z7j++yswlUustzo7l14jPJIgbe5 C22YegLU2XGlr9tX/uzDUjO6WwWLu3QTWIJF5l0C86yHptpuYjbJkV5zE 796yb7nInmfkCUYzt+ejxgbeTsIMQncy7gPS48VKIzWN/uB0oB9bMiR3u zUOUbUYvpAHYb5GhXT6T1fC926jDqhttDfuVSkog9iy5PAt9OdadoV4+6 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="269869070" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="269869070" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 19:59:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="572791625" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 12 May 2022 19:59:12 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 12 May 2022 19:59:12 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 12 May 2022 19:59:12 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.46) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 12 May 2022 19:59:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BM0/HoA+ITj7eyDmdt3uaNCYYYiQZym0J/hdUHZ85+A/RCcKDn4DCx5cOodalt2uJouB9kZQt0/pX+TQ91q5xkCKV8g6yytOrUAyqVRZmskxOX5l+wmZ32KtKeEdvDHcpcreCl2jjc03lb8T9GFKzcOQF2SnNHIhiCpnx15taun95yuAZrxOsP38AQwo/V7d1awj3UKYAUD7YGDDnsKBNsxBFF0vlNmNhSg7wbMj6wWvrqCkpXHjHJOy6uAOhl7s2TqOSJbKNez5DHI3kGG8ZcR5ix7hc7DIOCfP8C0y/RElw2VrS3U973ldDiT0NBmouUwLL3fPVnoztYatC0o8hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/nhvtk/v4SUPBshJ18oALUlG68aIP5lcBGKWR+SULUw=; b=QsHpyuEFi65MGHa/UC28fSaRJzcC94rear23reapeMFz8xUIfzecn772YpOLOgLdC4lJnZcD1Hc4NlKGXrAEHS8W08My9pAbW9ixshVKWZ4wESqdiE7k0mUpsC4K4RxlOXYOOVaXvJ53jNGta51FPCAu7zK7XbuBHCYEwdIGeq761x3hv8oh4A1sciEGJNbrDcGYOrYnE3YJhg2a6QXPHA/Zbdzey6V7ZsnN/TmBWYn6RbF2TrToZ1bhHk4aS8axE8jBcmXqGsPZtW3uGnBqH6SvBht6CuWQoELxwopjlkhljpzb8fNzf60iM/JJ+b9FGl1rcwcemWMhHKV6FD6NRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by BY5PR11MB4243.namprd11.prod.outlook.com (2603:10b6:a03:1c8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Fri, 13 May 2022 02:59:10 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::2c8f:42df:ed85:99e5]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::2c8f:42df:ed85:99e5%4]) with mapi id 15.20.5227.023; Fri, 13 May 2022 02:59:10 +0000 From: "Xia, Chenbo" 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 inflight IO Thread-Topic: [PATCH v7 17/18] vdpa/ifc: blk device pause without no inflight IO Thread-Index: AQHYWheNuKQF5t+hiEGbU8LTESsNfK0cNnwQ Date: Fri, 13 May 2022 02:59:09 +0000 Message-ID: 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: <1651048206-282372-18-git-send-email-andy.pei@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9e445a86-a422-4610-19ef-08da348c8d77 x-ms-traffictypediagnostic: BY5PR11MB4243:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: o0TI70FJaN10LC5J9pEcd48AatComOHTUdqY9K1H4QE8Oa7DpGCa9b4Vj+Qpe4hHegzVWfOMo7phvmTe8Qa/Pk7u+nz3f+GLS474/hrc9K4dzJ+A4MTXfttYosFxxblXAi8kFSIHBYqFUAXBdY2ILiELisd4KYL41jfA/A0bUtmmw1bjNQOsJK9vtvr93YOESH67W0mbqFjUNlhDruLKcIgKt/e8EM5tj/1wJDJ9q7Bp/Mj30syxouFA5BwAevD7m+dU5/rcij7ZH4IOrUH1tu8JuUmZWWd/IxjEmr96ymx+c9pvMkkqej0/s8lZFgLyoQz+9ZD4QQYpwrPU9nTydjIbi3TwLcYBMF9sq33WAR4XwHtvW+XgLm+jkirqwJTxfF+MqA7GFtbYEObF9tEzxOPQhXqvGEcMdvseWET5/RIETd/RghdU8aD/PGMMHxxnH+nIQFHA+fUVNmP0yvtVFQHpf9GprPl3wZVcFHR4yiR9KsplZnkWn69QX9vvJUfJV1N1pb2sUoZsyxpbHEyHim8y0osvr08A8/4LrMxK+GBR3sWZskTw8kmAUyC4Rl4vkL9nF6DRmZwcrOf/qK9h+dxwZNR8sY0uaSQWAHHZ3nDKh08TB7dtBEPyUNQC1kLevf585TxldvHEZNyLu7hGBDQ7NdMXKGQXxuexQyvQndTxmch+HMlH5t+1ZRAwSsvGuPxnqoY8SOMQHgGHziEK2g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(4326008)(122000001)(86362001)(5660300002)(8936002)(110136005)(54906003)(38100700002)(38070700005)(71200400001)(316002)(8676002)(66476007)(64756008)(66556008)(26005)(66946007)(66446008)(107886003)(76116006)(82960400001)(6506007)(33656002)(52536014)(83380400001)(55016003)(53546011)(186003)(2906002)(7696005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?u6nvxzTretXRcLT50ixZamZMkcebkz99vSpzwvJ1nvVjzqaAjc3fxSM6LfvO?= =?us-ascii?Q?AsnX5xzuOtzCLYjSbBpBzLRL956xuWAGPTbXHVk+GfU22m8or00JLpWyy0k0?= =?us-ascii?Q?xpGyKnM0XgvX2PH56pu+hjkVueaDwqYCwfTFw7f8IirGUmfLGO5uPoKy4NFj?= =?us-ascii?Q?xXZdMQpOzrQ+kWvZ5MeLmo7Ir7qKU8ygNjYO3eu1ZiSFTE60CXhYfzGROk/z?= =?us-ascii?Q?Dp/jkU1YvELlEE61AgpiiLJX9jgG1iOzZS92KXMunmjV4QTSB0a8vz9awyWi?= =?us-ascii?Q?LJkJGq+LjuYw/VNdZDXuMBJAQ1KYClDto4Y1S+8eLCv+VrgIydf0CdQg0FRs?= =?us-ascii?Q?2uIQI2fPGFTJzNoU7iDfqpzCamTnxVBp9fHi8lyoIH3AaOO+XfKiQO4kXc/9?= =?us-ascii?Q?1GD3UThXWDlnl2fY8pPwIzmLCEVokDLbFJ9ZSnUHLfcKFlleslcBSYMUQq3u?= =?us-ascii?Q?loI5+Sd8/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kfbZKF4vZKDJj?= =?us-ascii?Q?C5yYZjPSI8FWV55mWAWGIhdQv6CPRK6U7QwNcX+dBMO8OH9MJsK0l2Eo+QSU?= =?us-ascii?Q?gIVRsWNWoYgfhbVl7mPoUppWCB6tUyQnTY3m+0F+xbj+Irb3eLflF+o+NBJz?= =?us-ascii?Q?uhHiYVEOduC+g1SsAMQO8h4NJlfva6h4Ek09YN5ZK0JK3laEnNzcFdHyXXfp?= =?us-ascii?Q?laOFaMmsOokNCMS39aCXdjX5P2ARF+m0msJ25rY3+bOaGwvo/dQ78jbqkQsh?= =?us-ascii?Q?VujNwCrGVTIcBlNp/5CPJWwI1ctVLyvMwmoY2MyRwf8vf/yFSQAtDYCe9sP9?= =?us-ascii?Q?WtLlkgHSwXDSK6fAFx0D8p4w7hoeWdmGYXHkTKnGLqvL5+vqyyOzPSX/IjZk?= =?us-ascii?Q?/Jszh5j5MA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e445a86-a422-4610-19ef-08da348c8d77 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 02:59:09.9648 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XldScrst/v88ZBPlFW5lUCvwVGNIytS8lZGCC85uL9RUx+WJZid9biOaHJc0Rm978iDbS2DEf7IEAa2euj12nA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4243 X-OriginatorOrg: intel.com 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 > -----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 >=20 > When virtio blk device is pause, make sure hardware last_avail_idx > and last_used_idx are the same. Patch is good. But illustrate more on avoiding in-flight packet in commit l= og Thanks, Chenbo >=20 > Signed-off-by: Andy Pei > --- > drivers/vdpa/ifc/ifcvf_vdpa.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) >=20 > 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; >=20 > vid =3D internal->vid; >=20 > @@ -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); > } > } >=20 > -- > 1.8.3.1