[dpdk-stable] patch 'vhost: forbid reallocation when running' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:32:57 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. 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.

Thanks.

Luca Boccassi

---
>From 9671137d3bf86b84318be2680014e8c74c0590ba Mon Sep 17 00:00:00 2001
From: Tiwei Bie <tiwei.bie at intel.com>
Date: Mon, 19 Aug 2019 19:34:55 +0800
Subject: [PATCH] vhost: forbid reallocation when running

[ upstream commit 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd ]

When the device has been started, don't do the reallocation anymore.
Otherwise the pointers used in application threads can be invalidated
without proper protection. Instead of introducing a global lock to
protect the change of device pointers which will hurt the performance,
let's just do the reallocation during setup.

Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc")

Reported-by: Yinan Wang <yinan.wang at intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost_user.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 221217c3f4..2440f14846 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -341,6 +341,9 @@ numa_realloc(struct virtio_net *dev, int index)
 	struct vhost_virtqueue *old_vq, *vq;
 	int ret;
 
+	if (dev->flags & VIRTIO_DEV_RUNNING)
+		return dev;
+
 	old_dev = dev;
 	vq = old_vq = dev->virtqueue[index];
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:27.547411977 +0000
+++ 0030-vhost-forbid-reallocation-when-running.patch	2019-12-19 14:32:25.761291004 +0000
@@ -1,8 +1,10 @@
-From 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd Mon Sep 17 00:00:00 2001
+From 9671137d3bf86b84318be2680014e8c74c0590ba Mon Sep 17 00:00:00 2001
 From: Tiwei Bie <tiwei.bie at intel.com>
 Date: Mon, 19 Aug 2019 19:34:55 +0800
 Subject: [PATCH] vhost: forbid reallocation when running
 
+[ upstream commit 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd ]
+
 When the device has been started, don't do the reallocation anymore.
 Otherwise the pointers used in application threads can be invalidated
 without proper protection. Instead of introducing a global lock to
@@ -10,7 +12,6 @@
 let's just do the reallocation during setup.
 
 Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc")
-Cc: stable at dpdk.org
 
 Reported-by: Yinan Wang <yinan.wang at intel.com>
 Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
@@ -20,11 +21,11 @@
  1 file changed, 3 insertions(+)
 
 diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
-index f468436103..e4ae027a05 100644
+index 221217c3f4..2440f14846 100644
 --- a/lib/librte_vhost/vhost_user.c
 +++ b/lib/librte_vhost/vhost_user.c
-@@ -410,6 +410,9 @@ numa_realloc(struct virtio_net *dev, int index)
- 	struct batch_copy_elem *new_batch_copy_elems;
+@@ -341,6 +341,9 @@ numa_realloc(struct virtio_net *dev, int index)
+ 	struct vhost_virtqueue *old_vq, *vq;
  	int ret;
  
 +	if (dev->flags & VIRTIO_DEV_RUNNING)


More information about the stable mailing list