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 0F92DA00C2; Mon, 28 Mar 2022 16:59:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2DB242879; Mon, 28 Mar 2022 16:59:10 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C6DC4427FE for ; Mon, 28 Mar 2022 16:59:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648479549; 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=L8jY2VAxMGrc7E/xVBcahI4u6K9Qupau0YLFkm6+HyI=; b=L191IrDKIkqArcFaV73ldgNHfJT0aZwzqV9YK4h2w+n0Bg/vEMNJSTIXQr94mUx0E2cH1H /m3+MD9Ipj/MainHq8ynPW6YHUIisztogZD0ogpqwqbJTimlcBw6byUr9Bd/MrsD2AQPjz ThbU1Gr+2oOu0GHD3Vysu9vOHLB5PU0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-274-y-Eg3X7OMhSd6OhIjEnwfg-1; Mon, 28 Mar 2022 10:59:06 -0400 X-MC-Unique: y-Eg3X7OMhSd6OhIjEnwfg-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 99726100BAAA; Mon, 28 Mar 2022 14:59:05 +0000 (UTC) Received: from [10.39.208.2] (unknown [10.39.208.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B32F040D1B9E; Mon, 28 Mar 2022 14:59:04 +0000 (UTC) Message-ID: <46586efd-2b88-a0c2-8d3b-b785f3fc26cb@redhat.com> Date: Mon, 28 Mar 2022 16:59:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: David Marchand Cc: dev , "Xia, Chenbo" , Ilya Maximets , dpdk stable References: <20220324124638.32672-1-maxime.coquelin@redhat.com> <20220324124638.32672-2-maxime.coquelin@redhat.com> From: Maxime Coquelin Subject: Re: [PATCH v2 1/5] vhost: fix missing virtqueue lock protection In-Reply-To: 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 3/28/22 10:07, David Marchand wrote: > On Thu, Mar 24, 2022 at 1:46 PM Maxime Coquelin > wrote: >> >> This patch ensures virtqueue metadata are not being >> modified while rte_vhost_vring_call() is executed. >> >> Fixes: 6c299bb7322f ("vhost: introduce vring call API") >> Cc: stable@dpdk.org >> >> Signed-off-by: Maxime Coquelin >> --- >> lib/vhost/vhost.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c >> index bc88148347..2f96a28dac 100644 >> --- a/lib/vhost/vhost.c >> +++ b/lib/vhost/vhost.c >> @@ -1291,11 +1291,15 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx) >> if (!vq) >> return -1; >> >> + rte_spinlock_lock(&vq->access_lock); >> + >> if (vq_is_packed(dev)) >> vhost_vring_call_packed(dev, vq); >> else >> vhost_vring_call_split(dev, vq); >> >> + rte_spinlock_unlock(&vq->access_lock); >> + >> return 0; >> } >> > > Reviewed-by: David Marchand > > You can probably merge quickly this fix regardless of the rest of the > stats series. > It would help me with a series of mine that annotates vhost locks. > > Thanks for the review. Applied this single patch to next-virtio tree. Maxime