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 1CF1DA00C3; Tue, 20 Sep 2022 05:01:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEE4A4069B; Tue, 20 Sep 2022 05:01:02 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0786F4021D for ; Tue, 20 Sep 2022 05:01:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663642861; x=1695178861; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nAxRI0ANIAtthm0eCDcpPb4RjTB1dvoyV7Aecptm/oc=; b=Tw54+6jRz+RC+zCuO2eEnsX4AY4kixJ2qvUeAbpHgJ3gGFzhFNgpSDfS B2+d90V0XjneCcV89VOWaM4Wh8bxgZbtyQtse+VvVeTnYvPvO0WS9zlnr 4xQiiOpnqgw3w+Fag3dwj+BPgcDUm0U5PPgzi23AHOPsbIj8/ERTRy0CA n5UgBBSN5dMm63DOVvW/gnPH+B+7qHQk+kHS5za+N/raHX22/K5wXg5Jq BqxzeF3fXUZUr1VWhPJ+DbY4aV+lnhB2ycI2hVC9LbCqI5FzyFv1zNjOf IN9ix83PfZ9Pcfg3TKL2njbbIO6RvH8uKJhBTtEHdOcjgUlz6KVbf92OL Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10475"; a="279962067" X-IronPort-AV: E=Sophos;i="5.93,329,1654585200"; d="scan'208";a="279962067" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2022 20:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,329,1654585200"; d="scan'208";a="761125812" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 19 Sep 2022 20:00:55 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 20:00:54 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 20:00:54 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 19 Sep 2022 20:00:54 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.46) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 19 Sep 2022 20:00:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eUh1LT8YSLey9Ga4WkOmV+cMK//euXY7A+uOzHJaHEdeHFQelKp1TNLwqVKdaTg11Z09bTo6g5bqZgBJc8XW93/cRA7U0MGm8PjehBuKaNXOUFb1qRre0ZEALqCGi8Tu00rGxzYVcQjuijBlMrVSzYUd2f1y3U+I4l7qts5sc7I2mXR2HaIvKKqP39yimpzHM1V5j0clqJjYagKkgE8UR2nLc6kiSGAtFOCMI4GdHYQgj5qXRA5Q5dHkrL+7xNXND5vTL0PePo6Pk1qEK+FaUjZTjVD/NEpE1+XGSw60deeSYjYlPWd2c9JA9s5xJ+q0g+wPbUvNETal/gQrVcQNMw== 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=MTi9iCFRGRdwSUU20rEfvyRIWCTzkLOFQQJzKf/7TZo=; b=JgDoIdPoLIVOAAYdCMIptP8oGYeEjMsfmNdiUq+cYtXndTJGs+/df7GhqcidBwwhnu7YjGqeeZdgXejJ4AGHJ4WuqrgWr3mwy3cgTipXhYvh7nqEBn4SKYRBt21wSF0ILk+nXr7adUuQf9uyYLwhuLOGLPIgFkbP29RIVYTBL7QuJN0IBt6uCS1aAq/3YcaZmr/LiB8QAG4Te1URelVEN9MWqjs8q5TClpsn7ESbUUNGRtYfAqG4G9UYvm9kT9NrDiDj/pibDW9ImVbXzPwmx4Bq8Npin+Mz9TtdFDo1QIu4hmB3KN9uca/Wy/FEZDEa1EetrjkLcsdatJ5NL/lc/Q== 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 PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by SJ0PR11MB4879.namprd11.prod.outlook.com (2603:10b6:a03:2da::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15; Tue, 20 Sep 2022 03:00:52 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d5ee:238c:c9e8:788b]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d5ee:238c:c9e8:788b%6]) with mapi id 15.20.5632.021; Tue, 20 Sep 2022 03:00:52 +0000 From: "Liu, Changpeng" To: "Xia, Chenbo" , "dev@dpdk.org" CC: Maxime Coquelin Subject: RE: [PATCH] vhost: use try_lock in rte_vhost_vring_call Thread-Topic: [PATCH] vhost: use try_lock in rte_vhost_vring_call Thread-Index: AQHYwZeRjf3mjtMrEkOd0Zp5P1Nw9a3nrQ0AgAAA4sCAAAdTgIAAAOmw Date: Tue, 20 Sep 2022 03:00:52 +0000 Message-ID: References: <20220906022225.17215-1-changpeng.liu@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.500.17 dlp-reaction: no-action 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: PH0PR11MB5093:EE_|SJ0PR11MB4879:EE_ x-ms-office365-filtering-correlation-id: cd8ed49e-d576-47b5-7465-08da9ab45406 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h+aJ2HROJwAt5tjZ2piV3zCkLoL4pMxpSorWwrGxFq/era9k2evpSDLvqCRToHKo/WDMT0ejNTw/5z1qBFCzNNTPLyk/MNSOnKIMc9ATVet3a0zlH4OV1/nF/90K0aQyOzcKIdsnAXar/+6vcNwvCa5jHYydOSKYrwLgO5To4m/FU9//h32dbNX34kT+y6/U7hUrHe/zvdTUNPcsbNz9uItytbcCMPHMswF61Tp9IU8/BsCkTmvy/6eT6VDucEW9XRN5kCNC990ELQ9JICEVFImZsSjhF9e/1LokwcjjQM8FYaFS4zfqcW1ywVohboz+IIFppay7YYl9MqpW5FdrJknrBUgy394jhN7MAZrwXAWRXtKZ4jv/O1nD6VizVoSBIdpVxTMsZoZGAzBZsTokscRn2fxmAbwOi5bhod2p8FAMoDTc58koMgMz5KYqY3FgQSunPVWMi4F7bBepqbv/S9CQds3g5naHa/gRJc8dAiJThWaPu7IJ2EHFrHJ7NaU82X4amBef1EdZf8c4wqaq/1Jh6dL8qs7g0zy47AiDpbHMFBp3O+qpJpeazaVCxIB/YuqR/1REMBEeN9XASIt4TKGY+floQ2ifRJdCVthmhkGvU77cpuonKlGpLkGXA/y8NdIyXpHf/QIt/yXQpt3VolnB+NMX3Qm65RWuUYTznDRgS0oy4EhKaCd/LdAaOA9meLpXkDxa+YgSIZSLfu3K4oieQM2zzm9FXBDiVxr5efYA2YDcAv9C/XBOnosrPf9HIW/vGf4tGPNpmQHlVVGHQA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(366004)(396003)(376002)(136003)(39860400002)(451199015)(186003)(38070700005)(86362001)(76116006)(38100700002)(83380400001)(82960400001)(478600001)(52536014)(55016003)(66446008)(8936002)(6506007)(66476007)(122000001)(9686003)(66946007)(2906002)(26005)(64756008)(66556008)(41300700001)(53546011)(7696005)(110136005)(8676002)(33656002)(4326008)(316002)(5660300002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?1JcGEE3POb3uOy20fOH4emnIkeHW1bpSaiMkDNAN7SuMKV3Pxs7oMfeQ?= =?Windows-1252?Q?iIvnqBoKTGsFodeiL5tJds+Z31buSjvzqWfbHUrqXh47dbhDxkEHV30A?= =?Windows-1252?Q?8+x2kF6yrUeTqDG8q3XII9X0HBoU8CdHO+hQon1HQ6/ObYEvXzj13ow+?= =?Windows-1252?Q?m973gh2h48vrDa8mrTh3qA9l4269lWpL28PAHr+PhDZVGhK/OmiBgOtr?= =?Windows-1252?Q?zvl3FABIn4wI3p7SkQbkmoERfZ4BS30DhQape+trp1sBTidobxfDsDDy?= =?Windows-1252?Q?swJUaHYx3fG61R7RU/HR+jb85qmO0tS2oImlEGXyTYnAhtWSDf+hVGfE?= =?Windows-1252?Q?ByOAaIIq045Wt5XeHFuWS5i6kqmEPHH4YL55exXFjqDQsPFn9A1NdQZL?= =?Windows-1252?Q?XOcPtoq5RivP5KXxkU+IVCAbMnd/yk+vnpZcSLpYSyV7eNXo809iMRku?= =?Windows-1252?Q?u5iZFI5jPQVu45uQJWLuQsx2T4gKSXM2YnHZYzQgAB8ZW0hxpQ3PQAWH?= =?Windows-1252?Q?9aQAgS1xGYlZ53vOH/jIY0iZ8iRXeFQO6QmtSKcIreWt/ExChQZlVCN/?= =?Windows-1252?Q?9Xrct9uZJRm5BGj3WL2T6YHek+5Vf5oa5hw8TQ8kA+d+PMLhsFM7gBBK?= =?Windows-1252?Q?z27vAJshet8hwPc5Wmrd9EdHFrT2GIaEIZF3GE4aKHeQPIsT/PenvJ9N?= =?Windows-1252?Q?U7OjTzRM/ebQgziBpYTBUqLOkMQ3AQNIRpNnEekf5adR1CgtC7zOdWOZ?= =?Windows-1252?Q?6nQgB6lbOXwxoZorvRDfttsNWCsnvCZA4ZfnTe/7CLTUQWbGy8bwochM?= =?Windows-1252?Q?oVkmMP2yF7/l86EMeMghkxPMlmYjbqQV2jPyyIBvfcnZjDcVDEuhg9Jz?= =?Windows-1252?Q?GkEw0e2m4gN413BLNUo6Ryqsv4d0b8QvpZYnc1wsfLTKOTWbDIul0/5p?= =?Windows-1252?Q?imt97Qi5wDZ23oi/+DAZjoKh6pWvfnUPyBr+qumoIukgvhizscN+zy5W?= =?Windows-1252?Q?uUvsSGiuXwXusu2iYmepo44imaUZWcvL1nYs60e+poWBxq2uvo1pIlM8?= =?Windows-1252?Q?8av3eTXOESgbx2pkV0xQ//9cRH0uaYmwJFvVb5nt0Bb4nMG3UA/LQxZ3?= =?Windows-1252?Q?dIMaXcUmBWbsWGbq8mdyO8bzuL4qAzdmN51y3Z03VSWeqdje9V94tqlj?= =?Windows-1252?Q?1JY7SUeeu1olZurJhLAqwkgFeixbuqcrHZCTlS4xQEQsf3Oeh5/TQMzM?= =?Windows-1252?Q?8dtOSg74epGQPrbLyttjbbSzTYbyEr/uGOEUva8rmsJYol+zKlV4q+LZ?= =?Windows-1252?Q?ZUYNTljsDjFtMZ5/+T+wNCzE+zOXBwKg3GQqkFGRtMFgTiKEIH72Z4r5?= =?Windows-1252?Q?39LGCHlRhoBpWoxtMMSNlCIelmsYAb23idJJAd0HjZd8ReEXl92mUZdL?= =?Windows-1252?Q?RWSCHKJYr42sVuWuxC0lk/gVDp0/p2dqGf3MOTlpYuZzVYNR8DbksFeR?= =?Windows-1252?Q?9lf1x6GMTEblfZbOPRYlhVsm2gZhvxWQ0TdhtyqDRugyxLt3cR9bWivi?= =?Windows-1252?Q?X4Bl3uYoITh41P/TErhjnIwvvTla4521IMrQ9IveGbdVgQvN9X2BZaZH?= =?Windows-1252?Q?S/VQIm56bxSZaNYCMoqzuNngftczlO3bYChszFpbEGcq6lL0aFShJ2yV?= =?Windows-1252?Q?3nm6Y3aUDBmcjW8ESxN10QH98jxgzlf0?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd8ed49e-d576-47b5-7465-08da9ab45406 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2022 03:00:52.0690 (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: h4KP/OTTxvBxLLhIYU4vfrYp7eSB6zq0i/OaVZMYdX4yGxiWSQl6wEzPzzU26+KU2khzmN2j6lIYdD/Ab7N6Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4879 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: Xia, Chenbo > Sent: Tuesday, September 20, 2022 10:54 AM > To: Liu, Changpeng ; dev@dpdk.org > Cc: Maxime Coquelin > Subject: RE: [PATCH] vhost: use try_lock in rte_vhost_vring_call >=20 > > -----Original Message----- > > From: Liu, Changpeng > > Sent: Tuesday, September 20, 2022 10:34 AM > > To: Xia, Chenbo ; dev@dpdk.org > > Cc: Maxime Coquelin > > Subject: RE: [PATCH] vhost: use try_lock in rte_vhost_vring_call > > > > Hi Bo, > > > > > -----Original Message----- > > > From: Xia, Chenbo > > > Sent: Tuesday, September 20, 2022 10:25 AM > > > To: Liu, Changpeng ; dev@dpdk.org > > > Cc: Maxime Coquelin > > > Subject: RE: [PATCH] vhost: use try_lock in rte_vhost_vring_call > > > > > > Hi Changpeng, > > > > > > > -----Original Message----- > > > > From: Liu, Changpeng > > > > Sent: Tuesday, September 6, 2022 10:22 AM > > > > To: dev@dpdk.org > > > > Cc: Liu, Changpeng ; Maxime Coquelin > > > > ; Xia, Chenbo > > > > Subject: [PATCH] vhost: use try_lock in rte_vhost_vring_call > > > > > > > > Note that this function is in data path, so the thread context > > > > may not same as socket messages processing context, by using > > > > try_lock here, users can have another try in case of VQ's access > > > > lock is held by `vhost-events` thread. > > > > > > Better to describe the issue this patch wants to fix and how does > > > it fix. > > > > > > I remember it's a bz issue, do you want to backport? And it has > > > some bz ID, we need to add it in commit message. > > Actually it's my intention not to add bz ID, as I think for this bz ID, > > It's better not to lock all VQ's access lock for KICK/CALLFD messages, >=20 > Do you plan to add this change? I think that may be an improvement to cur= rent > locking implementation. No, I don't have such a plan. >=20 > Maxime, what do you think of this idea about only locking specific queue = when > handling vring related message (not global config like mem table)? >=20 > > What do you think? If this is identified as a fix, I can backport it to > > 22.05. >=20 > You can decide, if this is planned to be the fix, just backport. I am jus= t > thinking if this is not the fix for the bz, do we still need this? Adding the bz ID is OK to me. From SPDK's view indeed it's a fix. Will send V2 later. Thanks. >=20 > Thanks, > Chenbo >=20 > > > > > > > > > > > Signed-off-by: Changpeng Liu > > > > --- > > > > lib/vhost/vhost.c | 6 +++++- > > > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > > > > index 60cb05a0ff..072d2acb7b 100644 > > > > --- a/lib/vhost/vhost.c > > > > +++ b/lib/vhost/vhost.c > > > > @@ -1329,7 +1329,11 @@ rte_vhost_vring_call(int vid, uint16_t > > vring_idx) > > > > if (!vq) > > > > return -1; > > > > > > > > - rte_spinlock_lock(&vq->access_lock); > > > > + if (!rte_spinlock_trylock(&vq->access_lock)) { > > > > + VHOST_LOG_CONFIG(dev->ifname, DEBUG, > > > > > > Should use VHOST_LOG_DATA > > OK. > > > > > > Thanks, > > > Chenbo > > > > > > > + "failed to kick guest, virtqueue busy.\n"); > > > > + return -1; > > > > + } > > > > > > > > if (vq_is_packed(dev)) > > > > vhost_vring_call_packed(dev, vq); > > > > -- > > > > 2.21.3