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 56CA1A00C4; Fri, 1 Jul 2022 15:58:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B35B40E03; Fri, 1 Jul 2022 15:58:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 2CF0540A7D for ; Fri, 1 Jul 2022 15:58:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656683901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ilXS1M8IyjOw+DDNuClZgbC4MYZcODWsgyIxYn+fzPE=; b=i4VKsE+oH6nLLjuYLMKpRjI0W7ssmjQn9ukkpuE6arV9bu6oEmdLjnUZUI5hseLdeTYO0v swWYT5X7uRkWv+zVXw4zuEv/R8+gSDMurCsNslJ93tRVvGUnprehnZMb0PrmlJ4f710QrU SrHFAEl51NVQKfNE7jcQAYZboBJaZHw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-w62cNFMiPj2kxFZgw7VVAA-1; Fri, 01 Jul 2022 09:58:17 -0400 X-MC-Unique: w62cNFMiPj2kxFZgw7VVAA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 38C6F280FA15; Fri, 1 Jul 2022 13:58:17 +0000 (UTC) Received: from [10.39.208.30] (unknown [10.39.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAE3D40C124A; Fri, 1 Jul 2022 13:58:15 +0000 (UTC) Message-ID: <42f0ebb1-da76-c565-1db3-bdb34d720da7@redhat.com> Date: Fri, 1 Jul 2022 15:58:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2] net/vhost: fix deadlock on vring state change To: Yuan Wang , chenbo.xia@intel.com, dev@dpdk.org Cc: jiayu.hu@intel.com, xingguang.he@intel.com, cheng1.jiang@intel.com, weix.ling@intel.com, stable@dpdk.org References: <20220601142541.605301-1-yuanx.wang@intel.com> <20220627055125.1541652-1-yuanx.wang@intel.com> From: Maxime Coquelin In-Reply-To: <20220627055125.1541652-1-yuanx.wang@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 6/27/22 07:51, Yuan Wang wrote: > If vring state changes after pmd starts working, the locked vring > notifies pmd, thus calling update_queuing_status(), the latter > will wait for pmd to finish accessing vring, while pmd is also > waiting for vring to be unlocked, thus causing deadlock. > > Actually, update_queuing_status() only needs to wait while > destroy/stopping the device, but not in other cases. > > This patch adds a flag for whether or not to wait to fix this issue. > > Fixes: 1ce3c7fe149f ("net/vhost: emulate device start/stop behavior") > Cc: stable@dpdk.org > > Signed-off-by: Yuan Wang > --- > V2: rewrite the commit log. > --- > drivers/net/vhost/rte_eth_vhost.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > Applied to dpdk-next-virtio/main. Thanks, Maxime