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 8948DA034C for ; Mon, 28 Mar 2022 10:07:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FDD442874; Mon, 28 Mar 2022 10:07:19 +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 9B9EE42874 for ; Mon, 28 Mar 2022 10:07:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648454838; 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: in-reply-to:in-reply-to:references:references; bh=zj6a8bwhLqlGp2TkcxzDaRwOvruzQmzf6+J/OKGcT6Y=; b=VxM/j1lsewRdJoI08spDJH37QeQ1ALuQOvuoOIwTWobNiAnh9u4I0cBNkDJ5eCECiqhCUX lixPboRcYD/gTnW4zVBVjEm+Kw37bynqSKyzzBrbvvYtIvkOKch824UUcdnxnlPzR+1fif Q5VIufR5pZ8bUMRmhrmhfET/mFw8YHI= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-VlexxcMENe6mzyWWCavE4g-1; Mon, 28 Mar 2022 04:07:14 -0400 X-MC-Unique: VlexxcMENe6mzyWWCavE4g-1 Received: by mail-lj1-f200.google.com with SMTP id t10-20020a2e2d0a000000b002496423e4adso5630383ljt.16 for ; Mon, 28 Mar 2022 01:07:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zj6a8bwhLqlGp2TkcxzDaRwOvruzQmzf6+J/OKGcT6Y=; b=Yix+i7aPS5zWQxXRbEQBQK03LSSrYXBdihMBUJ7G5V1dNBOS2mOn6ZEhh36s66/V3T ntU/dqecEBwrJnW4uY3GLsK9xG02QblRpqcTiUM+3PG1JKIKJlL5fOSo1AF+blexazcp iaIa8AJ76/Z8WciG7oBBO40PhkzbTntFJLiRF45aXF3pdwYpu3Kz6Y419seLwrBcuy0P Gw0X6AwIATSw8tMTRuf6nxYFoxCGAFxxZE13PNyuduZMuq+gvo8jMOuCXi8SOJyFcHq1 Zq1hULM1C51D6lS7JYG2/QoCtviCyHa/ykkO1wmQ4UJtksQfhLjHvK/QowFmieT3N0JV TVUQ== X-Gm-Message-State: AOAM532f3AIXDnlQCB6oNAvafoT4dQ0PVxcuAO6nbD/5vOdkWCPfwg8j 4R5wTbFGJwkM5B80nLnKm/cE+YyuxJoWDM2kj6AZKCgV7g+Xlt5Bu+Avd7XgVaU/Gv/QZlfwz/s 1ZUKlUu3kFOFnjJXcbQTVxNI= X-Received: by 2002:a2e:8709:0:b0:24a:d0cf:21af with SMTP id m9-20020a2e8709000000b0024ad0cf21afmr2590375lji.46.1648454833260; Mon, 28 Mar 2022 01:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEmR8sYxEthBHL2o7qGzWYRlcBOBR8dLlpyW7cG4AV/GHmZ6Zq6/apyjnD+sOBX5yjE5i4o8zTGl5OcfUXpwc= X-Received: by 2002:a2e:8709:0:b0:24a:d0cf:21af with SMTP id m9-20020a2e8709000000b0024ad0cf21afmr2590357lji.46.1648454832955; Mon, 28 Mar 2022 01:07:12 -0700 (PDT) MIME-Version: 1.0 References: <20220324124638.32672-1-maxime.coquelin@redhat.com> <20220324124638.32672-2-maxime.coquelin@redhat.com> In-Reply-To: <20220324124638.32672-2-maxime.coquelin@redhat.com> From: David Marchand Date: Mon, 28 Mar 2022 10:07:01 +0200 Message-ID: Subject: Re: [PATCH v2 1/5] vhost: fix missing virtqueue lock protection To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Ilya Maximets , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 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. -- David Marchand