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 DF241A0540 for ; Thu, 10 Nov 2022 08:02:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D807A40A7D; Thu, 10 Nov 2022 08:02:20 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 77DB0400D4; Thu, 10 Nov 2022 08:02:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668063738; x=1699599738; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vuA1pM3eYfq7qAfMQ0waOYgO2VTmcsVzfnj3i5zixvQ=; b=JelVDuerpX9MEyGQmAP6YF/Cgzz9h6u7pWKZ6NmccRq6y2sryT+v1FAA DCwAl4uSWE7Vmp94fMFMhLEVa5gfcF7roAHWijbXkEJRtval9tyPi3Rc8 CiZH0KQ8A/QTEZl9XKaPXhcH4z4YMDwJ9w9zo98qjFn5BxM0fgrFE1B8g 6gfn+3oQqaDa4TjSCb/M3eQT8NIM8CRsv6iTfRugm8WVLpa2OXk5DyqZg cmAw4uSYIpVl3zjJAxTPszBtUOJhc/7H99AV1aDhG9tARUjXALthFL4d6 mw3ntMltddKNgoZtFGkqgaIL+SjPGfXkl/QBKMECEaG1/nn/ZG9I19qgo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="298726167" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="298726167" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP; 09 Nov 2022 23:02:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="639503699" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="639503699" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 09 Nov 2022 23:02:15 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 23:02:04 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 23:02:04 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 9 Nov 2022 23:02:04 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 9 Nov 2022 23:02:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRrdE2VuiWxqpxJSPovnVINl4cxJzSqYkwExU5a2j6IXAQnFSj+UcX1KVZRjHUMJZnVkjKs4gHLt6P+IQEU1186y03UJOl03x4hA7UvympZ/Z8DDd2HUQtdMcprWcVciDzsQO0ic2DUfxWCcX+F6NR6Z1sIYw7pKGWp8briUw2PdBNoYmuRSmCRbJjpFXM9SBQnzatv6Kvovd2bsursxBlxNrBt4vfSBK61PcxgEjA+QecZZOfZw9Yc+y+goc1IKqbALuejDC5jBIxte9gKB3Ded03BMJLtemmTX9QFhH98hn7mzUc1+XJ57X6/v7UN0fgjw4mnHp8gXXG6oOUP6Vw== 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=l6dt5+NkEi9EEswmGSY6s8TPFxgCpojAlGOtECvem+Q=; b=n3+/i+go4A5uks4z2EvQ008y7Apwxc8qVRQ7k4O2+34kmIfT8l1EUZ6FDk5gwMBxgqSo7cMZJpy58RROiVJBy531xCJz4yhdpy/pDk35t1EtlwZtC6SiD/W9gTWwbW2+juDacUDmQCWkuOEP/lDOQb2eS/NXi08zuYsCo8m4azlN0n2+FuBponHbSiSNh6LM6f2kjKRK8qdXmG/jnuLUTbU+CFa1cBU33AaZv+OQjHIDh56TruBcvAzLrB0Wds5G2+kC4TvY7bVR49B7HpY+h+dGNyDRf8UPNNT8RTEk2ovWV+noOugUsd7S9nKltctFBZykFChi+12+/gia/rn57w== 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 SA2PR11MB4905.namprd11.prod.outlook.com (2603:10b6:806:117::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Thu, 10 Nov 2022 07:02:02 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::3c6a:7a7c:129d:aecb]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::3c6a:7a7c:129d:aecb%4]) with mapi id 15.20.5791.026; Thu, 10 Nov 2022 07:02:02 +0000 From: "Xia, Chenbo" To: "Maheshwari, Abhishek" , "maxime.coquelin@redhat.com" , "Wang, Xiao W" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Mandal, Purna Chandra" Subject: RE: [PATCH v5] vdpa/ifc/base: wait for queue disable before saving q-state Thread-Topic: [PATCH v5] vdpa/ifc/base: wait for queue disable before saving q-state Thread-Index: AQHY72u0hwmiFiosgU6N4LhCid0+pq43xZAQ Date: Thu, 10 Nov 2022 07:02:02 +0000 Message-ID: References: <20221103043635.2334541-1-abhishek.maheshwari@intel.com> <20221103093500.2337873-1-abhishek.maheshwari@intel.com> In-Reply-To: <20221103093500.2337873-1-abhishek.maheshwari@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-traffictypediagnostic: SN6PR11MB3504:EE_|SA2PR11MB4905:EE_ x-ms-office365-filtering-correlation-id: a8d8479b-f49b-46d5-04df-08dac2e97832 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AdHUBzTjO9u6PQXKFU7irxY5LbMGjvliK2fzDbUkteBWqTls0DYDnSctGCW67Ovyc3lLaU0wyRX66UjIZqJd5WRwEWUb9CzjB7St7dt2RAB3eVsXqmxdoRoZE7Vi5gtnk9CRkx+NIjlQxysyqw7i1pJ9EX5BNzCqoqWtESxL2xspkzsPTDxx6YM3XE4ispVYU8XK0d+B7coTLC3dPIE6DmJLBNNO3fGwaPzn98S813vjgkBkuzMe5DOG24IfoqFiL7okO9XlkeiBctMqMhZ0m9oqfqoD3F43zRdn2aW0EaDtBnl6D/7/nZu3zpmgDyfgJkltjdWBWqrTV/MXfNySkWlLMX3fqe+sd+VcI7RCydqRhGwPZgsyzJFHHtC8QcwoLkJW+ESeepjEwyDCQ4ILI6HsHoyFU8hC9wkqINTntA4yC/mIBdsM+u6lgL4/00B+cr5Yn8GMN24gPAkRvs9/dGGuKzpsNRKPW6CiQ0vZMXU0QXlbWj0r0e2fDbzgOI27KCekS9++DBnILuOPmwTsTulTlLQmOGzE8Y5+LmsOVSzGfsU6o69MkRUlXaNOHvn6ggJOfvoh5djV/hEATqm1bbxnLK0YkP3mC8J8tpZPQwiT6lppKqPldlD+7cAh8Ln488cSTLuJB9E/z4zZ/rECg7DbNS6BTJWtjN7Q+LOQvrvAJ2zM9BWUPs8+9r2PXX5rfEVDfwlWiVwhu+jjpbZk6OSmUqWRZyH443aF+OwW1/rWiOuAIWKHwTFcXDr0lnH9gcOIHVga5LLjmdmheRdUNw== 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:(13230022)(376002)(366004)(136003)(39860400002)(346002)(396003)(451199015)(41300700001)(83380400001)(38100700002)(4326008)(64756008)(8676002)(82960400001)(66446008)(66476007)(66556008)(76116006)(66946007)(122000001)(186003)(9686003)(478600001)(26005)(6506007)(7696005)(55016003)(33656002)(53546011)(107886003)(316002)(110136005)(6636002)(54906003)(71200400001)(38070700005)(86362001)(5660300002)(2906002)(52536014)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gBqWdujMItEQWZKJC0g1pno950+pamfgbYRVRHGI96ExPcP8DInaVeO8R3g9?= =?us-ascii?Q?EWgYqxKVpPV23xxQRq5Q2e5nLk8IaPlHsa1SVVdlSKa1Tg1YxhcOY6TUjfTf?= =?us-ascii?Q?X1RyXyUOSBLRuNXvtGmRRxA/NTjGFpfb/pzlhjs0YoKfxf+JQfWOwNdLaVRR?= =?us-ascii?Q?FEiceBV02EW6It94UgOesm/sVzhMSCco/X3UWevRwcPewwQfgn0mmcQEuaAi?= =?us-ascii?Q?9ttUDgkxZUb3oNyIJD+j308mi0tpArzSDI5xrr4j52vcnQNjLhWv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NCYXpCdyHJeOUr3+jA/Z3MsxlQ/ey2I5?= =?us-ascii?Q?c0Gbu9DMIfyq43/oZ0V0ENaa6+sg+IODtcvwFCksunzkcR0ifS47O6Dbp1eT?= =?us-ascii?Q?ITdMFkJnJ5RRNybyQG0o7x+i6Ic+iaaoEqo85yllQ6D9b3LDf+IE26xVgtCK?= =?us-ascii?Q?qnHcD4tXnsY8/iKhuft0McPGO+eN/jZiqn+joD0IvuVITGPiAIkvkb08DGam?= =?us-ascii?Q?YwIMeok0TBTufZ6D/Bdo5cpd+OKfOe3eXhcXDi3cmM7omFx6gS/GXJCFjRy0?= =?us-ascii?Q?8ppmZw3GQhiAaS49nhWw4DbWJqSEV4jEDyj1KOl2H1eGNQ8YYA7cttDTdfbL?= =?us-ascii?Q?39Aa+c+kdl1RI4lUezJ7Uukko6IUtmXVByrwY4ws/B4veplbmOJBsFWqRGDs?= =?us-ascii?Q?hKgC4M1P8W7c6nngrji0VQofSro5EN3uaMp0/Q4u?= 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: a8d8479b-f49b-46d5-04df-08dac2e97832 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2022 07:02:02.5434 (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: wzJ54D/IgXzZZjiWP2edFKTH5ropOogKc3KiUeNKtP/8ttDzmrIR39ZSCBdXMEc8swcba5az6BytWsDzIHol5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4905 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Maheshwari, Abhishek > Sent: Thursday, November 3, 2022 5:35 PM > To: maxime.coquelin@redhat.com; Wang, Xiao W > Cc: dev@dpdk.org; stable@dpdk.org; Xia, Chenbo ; > Mandal, Purna Chandra ; Maheshwari, > Abhishek > Subject: [PATCH v5] vdpa/ifc/base: wait for queue disable before saving q= - > state >=20 > Some ifc hardware require synchronization between disabling a queue and > saving queue-state from LM registers. When queue is disabled from vDPA > driver, ifc device stops executing new virtio-cmds and then updates LM > registers with used/avail index. Before saving the queue-state, vDPA > driver should wait until the queue is disabled from backend. >=20 > Fixes: 5d75517beffe ("vdpa/ifc/base: access block device registers") >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Abhishek Maheshwari >=20 > --- > v2: > * Fixing the styling issues > * Addressing comment to avoid reading the register again after > exhausting the tries >=20 > v3: > * Fixing warning condition >=20 > v4: > * Fixing print argument format to %u in warning >=20 > v5: > * Addressing comments based on input that line length limit is 100 > --- > drivers/vdpa/ifc/base/ifcvf.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.= c > index f1e1474447..60555a6786 100644 > --- a/drivers/vdpa/ifc/base/ifcvf.c > +++ b/drivers/vdpa/ifc/base/ifcvf.c > @@ -257,6 +257,7 @@ ifcvf_hw_disable(struct ifcvf_hw *hw) > u32 i; > struct ifcvf_pci_common_cfg *cfg; > u32 ring_state; > + int q_disable_try; >=20 > cfg =3D hw->common_cfg; > if (!cfg) { > @@ -275,6 +276,20 @@ ifcvf_hw_disable(struct ifcvf_hw *hw) > continue; > } >=20 > + /* Some ifc hardware require synchronization between disabling > a > + * queue and saving queue-state from LM registers. When queue > is > + * disabled from vDPA driver, ifc device stops executing new > + * virtio-cmds and then updates LM registers with used/avail > + * index. Before saving the queue-state, vDPA driver waits > until > + * the queue is disabled from backend. > + */ > + q_disable_try =3D 10; > + while (q_disable_try-- && IFCVF_READ_REG16(&cfg->queue_enable)) > + msec_delay(10); > + > + if (!q_disable_try) > + WARNINGOUT("Failed to disable Q:%u, Saved state could be > invalid\n", i); > + > if (hw->device_type =3D=3D IFCVF_BLK) > ring_state =3D *(u32 *)(hw->lm_cfg + > IFCVF_LM_RING_STATE_OFFSET + > -- > 2.31.1 Applied to next-virtio/main, thanks