patch 'vhost: fix missing virtqueue lock protection' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:01:36 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/3763af6f3ee69851064034bb9c052893a2f9cdd5

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 3763af6f3ee69851064034bb9c052893a2f9cdd5 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 24 Mar 2022 13:46:34 +0100
Subject: [PATCH] vhost: fix missing virtqueue lock protection
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c5736998305def298e26f8fa73b9995f184fc983 ]

This patch ensures virtqueue metadata are not being
modified while rte_vhost_vring_call() is executed.

Fixes: 6c299bb7322f ("vhost: introduce vring call API")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 lib/librte_vhost/vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 1a7c240492..e76929d81b 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1265,11 +1265,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;
 }
 
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:50.698252861 +0800
+++ 0030-vhost-fix-missing-virtqueue-lock-protection.patch	2022-06-21 15:37:49.007784479 +0800
@@ -1 +1 @@
-From c5736998305def298e26f8fa73b9995f184fc983 Mon Sep 17 00:00:00 2001
+From 3763af6f3ee69851064034bb9c052893a2f9cdd5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c5736998305def298e26f8fa73b9995f184fc983 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -15 +17 @@
- lib/vhost/vhost.c | 4 ++++
+ lib/librte_vhost/vhost.c | 4 ++++
@@ -18,5 +20,5 @@
-diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
-index cf4bac277a..df0bb9d043 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)
+diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
+index 1a7c240492..e76929d81b 100644
+--- a/lib/librte_vhost/vhost.c
++++ b/lib/librte_vhost/vhost.c
+@@ -1265,11 +1265,15 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)


More information about the stable mailing list