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 68278A00C3; Tue, 20 Sep 2022 04:35:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F14DF4069B; Tue, 20 Sep 2022 04:35:00 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 787304021D for ; Tue, 20 Sep 2022 04:34:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663641298; x=1695177298; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=remzYJ5bBgXmxYwMs5Fz90ndqqfR+qTuI98FqjNF0tM=; b=IEn+YOfcfxiiERmtv+gVIVEEnk1CB1Q17AZkUPGWlMgIWpH9iYATNQsB ZLErUcvtUNJVOTmvr/RT6fD5YohgfqeU1hEpKYG/Glon34Rfz0qrptI/J 29wqM5PdFiS/aTVIoFbmxSNOZj7LnV+wdEvMELjbG7Pf5Iip2ARiSAnFy 7zVMK1tmZn3TIPK02Ykgn/7SlXTkOI365PzIcvvU25xLA58zMF3txiTMk aXdiZ5zEaZQRYDjM+0Bz96fckgFwLro8Xcmm/xmnVRu8pKshPS04OPJac aXxLZyN5vUTKnF0umP3RdzyvDNQGkGiequswhqK/5vVvhM9/M/R0dTKDI w==; X-IronPort-AV: E=McAfee;i="6500,9779,10475"; a="279303072" X-IronPort-AV: E=Sophos;i="5.93,329,1654585200"; d="scan'208";a="279303072" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2022 19:34:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,329,1654585200"; d="scan'208";a="722552102" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 19 Sep 2022 19:34:56 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 19:34:11 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) 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 19:34:11 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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 19:34:11 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) 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; Mon, 19 Sep 2022 19:34:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HXJUBHGuLRHmua5R/gSkvXDcokFBWOhOTCPrFeM5xDd+XF9e3LVHHLN38RRjPX89BF9uTqR0EjbzMHGGFVJ+I8K3XmjHqElVyyQVtU3KAS7e/tLbO7ejlS/SlkdU7GJ7u33Zih1Sm8CUwXVbWDWGli29b6EtOb2zwoXjox3a1oGkQQi5sL/vsY69ylSHTkTE2E/5IztW/G7RW7L2MLtH+cE0aFBdbN0UDI7Xn/clTJZy0Dco2Q5LlbsUheHdOiwc1IUELZJWPDayUHDDKMPiGwwdoj9Fd7ZUghVrpegUGO+qm7jVEFhTTStIw4TnKiCvciFIUVCkk76IyTeJ4DA9qw== 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=oihAWc5aikpBiEKLNloIwq2QMhsjKGYUudPHeSo2paQ=; b=cHgHdQ1i+il61slvJ6jUWSDEWZ63eB84wNUZlWVKKIYPNXvbFexkcsxgWTqx1697Oo3T9Gmm8OA14ZOgEU4jNbY3PHqqS83qljsVK4xCjvOhgTM6XP5eRFrYWO7RI3oEhBlh0HTnQQyLXm5SiehMpTVW1KWIWViEPwcfvaN1m2A+JtEXWyEze0/6PCV2W/3LAd+b5oRhLrPFOGBHrq8iGM7uQci93+Y2RWuN6Vqplxpegp2sdMxZvQKXPf8gUmr1b6025e8kt+ykMmAfHNOVV16PjjdMB3eO2KolYUaLeJQCSOmWTbV9qjKH3Azw6xolxS+9R/mei6OcNGB3+Q6IXg== 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 PH7PR11MB6006.namprd11.prod.outlook.com (2603:10b6:510:1e1::13) 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 02:34:09 +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 02:34:09 +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: AQHYwZeRjf3mjtMrEkOd0Zp5P1Nw9a3nrQ0AgAAA4sA= Date: Tue, 20 Sep 2022 02:34:09 +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_|PH7PR11MB6006:EE_ x-ms-office365-filtering-correlation-id: a5806e53-cfe2-4737-657e-08da9ab098bf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ltm7L3l1NsDUeL53yoD+NPdowLalL732sR5GUoOqYoMZcmTXLizzTDkLe2kRSbGn25MjmJcIfu7gx7TdhKt8hLEbIIwZNAob4msCAe3GJYW1vWxa4xrOjo2HHLlTVtumujJZnfRwmMMLo5nckQxBM7QDMPtYG+uwxxc+4O76PZL+ztrrM8r/EiJjSNRJcScYgrFdTjGWRDVSjx34FQeiTiqhAsewNSvmKOmHSbBddgEUOwRZkPCRmO53PEy4IgazxdL9RMUb4qJZYrad+KFF2AStnGUfmuWkoeyekB4cRgryTbQqlLAihy6Y5kB4Z/qucAlU21W2eLUGhHQNzXTo2kSn22jNEbm8ACxdtxiTkM0VKK6ZKBGzzrOGhuuj6xFi32ji/PJt/8aAeTk5AYZo4bLEHWLwNBO0zVjek/8B85eTIlR7kE8WAHncghxdss53lR32ushPO9WZEtmkcPO/MsXGyFEGSQbBzmsXtpOunO8pba44YVSlnTlkbEC6dt/PRwIwnIhE1yorRKJrX0HSB070i1cAb9rEswcsNeInfO9lz19+xMeuEL5vz6DC5rPahiWJCVo+QPB+oVf85+Jv8Gqk7qguldouXYVKQPzNCR2R3v7158LdDT3+5TPGav32RvSysVaNU4/cOa+XfkpjEjHiGAn0yhpuYmxCIIl/5cTN1c1O0NLbuU6xJNlvYHvxmiSIzzhghtgJlQbB6CF70b74C9Tb+JaROA5+A5Rid8NjUUPK5CqDYHecgCX0EIxzwoEF0WwOweZdY2yEpfH5EQ== 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199015)(8676002)(55016003)(71200400001)(478600001)(82960400001)(122000001)(2906002)(38100700002)(7696005)(83380400001)(9686003)(76116006)(33656002)(26005)(186003)(41300700001)(6506007)(53546011)(66946007)(66446008)(5660300002)(8936002)(110136005)(52536014)(64756008)(86362001)(66556008)(4326008)(38070700005)(316002)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?J8vzoRKgnQ/qClM5pAjvjEAfVfR6Vox2uY1rDNyHUM5vlevtd7JaL8tX?= =?Windows-1252?Q?+4Eni9vqpwEOR3Y0mg7d5KkQvWceW4wFNX7UHHvJzh2LSN5jIi4lQI91?= =?Windows-1252?Q?l/k/qTlHLLRdIxaESE4AhN8/MF+hroUOEOIC38WZwvKGXgQkFCsozsx6?= =?Windows-1252?Q?rTfv+sC/B+BCv9/jY2qxCJ8nkhkSFfJ3f9zWvy7CCX+noiD05GdIONxe?= =?Windows-1252?Q?1yQ32j32eKL1wAUIBKSUZ/XQb/srsZUEGCqG45wdkTAXbGUXX3upXlvJ?= =?Windows-1252?Q?mO3cv998QgCYrt7cPhhzNRHyel3EhgEnrV2N2364JG5+7jl7ORwof+Z+?= =?Windows-1252?Q?QgOuRoi+wk/ir9eyZg/wvpJ0vrxXSEXOpkyZVuh4O7/VowJWd6kXk6eU?= =?Windows-1252?Q?HsmYlBxFEovB4EvhtVCUj6vdVrQ7TmuoEKjUXzN5C4f7mgjfqNrVBEhK?= =?Windows-1252?Q?Y5YOnE6EjCm4J2ev7bbpy22f9Xb4wwKLwWe1/cURS6tp/4YrD9gT4PWE?= =?Windows-1252?Q?4llPECdmx9Ko32MH8xPLH0/pP5ZdFkM4FBci4ygzcj8RRF5H0t3glrTX?= =?Windows-1252?Q?pOLlldxFT0T/W47GWSxE6zH1EtIFCgCx+1TW4fYd5iI5xl6nhKmpJi1z?= =?Windows-1252?Q?nf48qUM2m9O+WVkg4ODIoAOLpWCi5kYFgx+FzeaLI4/axHL2ClEXqxZV?= =?Windows-1252?Q?jm0YHmelFQi519/FRwvx0DkegLclvkSdR9Ofi53zQnWsJnHO3JT+xbbd?= =?Windows-1252?Q?qbpz92h9uuVCgT44yUQx0TvRdtKuMWe75pM0g69P9fKQ5L1Wd7wo6TL6?= =?Windows-1252?Q?uhn8ScDDMkAiTw2adc5Dkp6wYCfE32X/lSABtNyW/tdm3QNViRzwPTuK?= =?Windows-1252?Q?pdVGNFPrmyTPo7uttQE4ASINjTK7LJfWgHxgFvKqVmHcHzlhqbX1LqtN?= =?Windows-1252?Q?wbZAIuITa8fbjqQT39tW7iRidkUWE5wicX6aKJYxxVBAyVGgqG0RZ+ix?= =?Windows-1252?Q?ytYnF9CkaI/rawoiiqaYOTyuntj51PUVI1L5b0PPH5f0weSa+JhKPBqI?= =?Windows-1252?Q?EY0x426rdEW8jbQsLD6lBYLh9kGjZ0/tzg8+6VYLwPRPNFHhGkn0vgPD?= =?Windows-1252?Q?cfN49DMtP9+3coRrYMOqOoeXXuEyGLN9yomOb/V3iPP6q/jFsPBQSGZk?= =?Windows-1252?Q?+3039ptEhn8xvKCwA7N97EwnCyZG7PUszfOqQor55flcsOaTYWQwYDRR?= =?Windows-1252?Q?aPOGlwKPiJH9blWXA5AG/0eraSGpnKShBUzpbRuZjPFJc78TsY2bvClg?= =?Windows-1252?Q?gPSBvucA0Pj7O74n7ZJIK0i6MI1m9IptEv4A5EC3LJUu45beoivrkVog?= =?Windows-1252?Q?t/j0vc9BpMqiI9tz9ovGXkXqKe1OYA8JrLlCb+Dk9ilClfyvAmJopuod?= =?Windows-1252?Q?7x558+WJty2e2mXvhHb3M8HpA1aNWvQp+bbBFpGv9ZWVICjV+pkykfwX?= =?Windows-1252?Q?NLwA8dZO/Pz9TwsLv43j57/WCVD6DxqbWQTMo5P7VDfTcHqJKXHR4Rlf?= =?Windows-1252?Q?2clDIIgyTOErQIbYTET+bxVmqg2kB62KZN9HIPesjSIIOm/AWCcGNosv?= =?Windows-1252?Q?559hHq5j7T240dEKYKt8O2WpUF6MIK7h4vnTstb8AosTOAl56wygdUr1?= =?Windows-1252?Q?MQPFv5j+k/jsk/ffwvLnUEi7v9DfyUzS?= 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: a5806e53-cfe2-4737-657e-08da9ab098bf X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2022 02:34:09.3479 (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: c1wyQRCJyut28jTR46d2cM1iRx3eynRXvcGbnvCt3n8s77BIl+1zWZqM5rbb4hdhyY1lC9mXi7CKuOFQv3eGUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6006 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 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 >=20 > Hi Changpeng, >=20 > > -----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. >=20 > Better to describe the issue this patch wants to fix and how does > it fix. >=20 > 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, What do you think? If this is identified as a fix, I can backport it to 22.= 05. >=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, >=20 > Should use VHOST_LOG_DATA OK. >=20 > Thanks, > Chenbo >=20 > > + "failed to kick guest, virtqueue busy.\n"); > > + return -1; > > + } > > > > if (vq_is_packed(dev)) > > vhost_vring_call_packed(dev, vq); > > -- > > 2.21.3