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 E0048A0A0C for ; Fri, 2 Jul 2021 09:36:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6AB14132D; Fri, 2 Jul 2021 09:36:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id AA84F4132D for ; Fri, 2 Jul 2021 09:36:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625211401; 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=8Afk1WNNNl+MfCbgNAP7Kl3X7IDZWdUzvsye0KXzmhw=; b=ZK/tQmGmVBO1yV6fPa6HZrbk+dO5m8a6YSVXIAsSiiiJRv8DGqzf8trdSuI+oe8QhgGUi6 oulOHC0L1fwhtQILhagtMXnQW+JB5flpqQEm7xTY2jKK3AWcyH1j71qsD4sqmX4PSW9DTS YcJPvTDN8QZBP6H2xbXIbNS2b/+3dNs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-qaYJGFLCNryONEfIkO0y2w-1; Fri, 02 Jul 2021 03:36:38 -0400 X-MC-Unique: qaYJGFLCNryONEfIkO0y2w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37B85100C618; Fri, 2 Jul 2021 07:36:37 +0000 (UTC) Received: from [10.36.110.32] (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 398A15C22B; Fri, 2 Jul 2021 07:36:35 +0000 (UTC) To: Jiayu Hu , dev@dpdk.org Cc: chenbo.xia@intel.com, yinan.wang@intel.com, stable@dpdk.org References: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> <1622189463-392610-2-git-send-email-jiayu.hu@intel.com> From: Maxime Coquelin Message-ID: <28e7fef9-4013-8402-ec05-be8d8b8d7088@redhat.com> Date: Fri, 2 Jul 2021 09:36:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1622189463-392610-2-git-send-email-jiayu.hu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH 1/2] vhost: fix lock on device readiness notification 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 Sender: "stable" On 5/28/21 10:11 AM, Jiayu Hu wrote: > The vhost notifies the application of device readiness via > vhost_user_notify_queue_state(), but calling this function > is not protected by the lock. This patch is to make this > function call lock protected. > > Fixes: d0fcc38f5fa4 ("vhost: improve device readiness notifications") > Cc: stable@dpdk.org > Signed-off-by: Jiayu Hu > --- > lib/vhost/vhost_user.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c > index 8f0eba6..dabce26 100644 > --- a/lib/vhost/vhost_user.c > +++ b/lib/vhost/vhost_user.c > @@ -2915,9 +2915,6 @@ vhost_user_msg_handler(int vid, int fd) > } > } > > - if (unlock_required) > - vhost_user_unlock_all_queue_pairs(dev); > - > /* If message was not handled at this stage, treat it as an error */ > if (!handled) { > VHOST_LOG_CONFIG(ERR, > @@ -2952,6 +2949,8 @@ vhost_user_msg_handler(int vid, int fd) > } > } > > + if (unlock_required) > + vhost_user_unlock_all_queue_pairs(dev); > > if (!virtio_is_ready(dev)) > goto out; > Reviewed-by: Maxime Coquelin Thanks, Maxime