From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2E33A04FE for ; Wed, 15 Jan 2020 05:51:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C527E1C01F; Wed, 15 Jan 2020 05:51:33 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id E7FC81BFFF; Wed, 15 Jan 2020 05:51:29 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2020 20:51:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,321,1574150400"; d="scan'208";a="424896565" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by fmsmga006.fm.intel.com with ESMTP; 14 Jan 2020 20:51:27 -0800 Date: Wed, 15 Jan 2020 12:51:25 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: dev@dpdk.org, amorenoz@redhat.com, zhihong.wang@intel.com, echaudro@redhat.com, stable@dpdk.org Message-ID: <20200115045124.GA26657@___> References: <20200114185357.25819-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200114185357.25819-1-maxime.coquelin@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-stable] [PATCH] vhost: fix deadlock on port deletion X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" On Tue, Jan 14, 2020 at 07:53:57PM +0100, Maxime Coquelin wrote: > If the vhost-user application (e.g. OVS) deletes the vhost-user > port while Qemu sends a vhost-user request, a deadlock can > happen if the request handler tries to acquire vhost-user's > global mutex, which is also locked by the vhost-user port > deletion API (rte_vhost_driver_unregister). > > This patch prevents the deadlock by making > rte_vhost_driver_unregister() to release the mutex and try > again if a request is being handled to give a chance to > the request handler to complete. > > Fixes: 8b4b949144b8 ("vhost: fix dead lock on closing in server mode") > Fixes: 5fbb3941da9f ("vhost: introduce driver features related APIs") > Cc: stable@dpdk.org > > Signed-off-by: Maxime Coquelin > --- > lib/librte_vhost/socket.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) Reviewed-by: Tiwei Bie