patch 'vhost: clean IOTLB cache on vring stop' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:11 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/70146f4f241e0af41ab12661adf35c4523ccb144

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 70146f4f241e0af41ab12661adf35c4523ccb144 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma at redhat.com>
Date: Fri, 27 Aug 2021 18:12:31 +0200
Subject: [PATCH] vhost: clean IOTLB cache on vring stop
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e7cb7fdf5471d96edd586dd318511d8a892c41ca ]

Old IOVA cache entries are left when there is a change on virtio driver
in VM. In case that all these old entries have iova addresses lesser
than new iova entries, vhost code will need to iterate all the cache to
find the new ones. In case of just a new iova entry needed for the new
translations, this condition will last forever.

This has been observed in virtio-net to testpmd's vfio-pci driver
transition, reducing the performance from more than 10Mpps to less than
0.07Mpps if the hugepage address was higher than the networking
buffers. Since all new buffers are contained in this new gigantic page,
vhost needs to scan IOTLB_CACHE_SIZE - 1 for each translation at worst.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")

Signed-off-by: Eugenio Pérez <eperezma at redhat.com>
Reported-by: Pei Zhang <pezhang at redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 lib/librte_vhost/vhost_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index f35b6423d7..7c16d2fc12 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1997,6 +1997,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
 	msg->size = sizeof(msg->payload.state);
 	msg->fd_num = 0;
 
+	vhost_user_iotlb_flush_all(vq);
+
 	vring_invalidate(dev, vq);
 
 	return RTE_VHOST_MSG_RESULT_REPLY;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:08.800344244 +0100
+++ 0047-vhost-clean-IOTLB-cache-on-vring-stop.patch	2021-11-30 16:50:05.662872591 +0100
@@ -1 +1 @@
-From e7cb7fdf5471d96edd586dd318511d8a892c41ca Mon Sep 17 00:00:00 2001
+From 70146f4f241e0af41ab12661adf35c4523ccb144 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e7cb7fdf5471d96edd586dd318511d8a892c41ca ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
- lib/vhost/vhost_user.c | 2 ++
+ lib/librte_vhost/vhost_user.c | 2 ++
@@ -32,5 +33,5 @@
-diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
-index 7b9f26b656..5a894ca0cc 100644
---- a/lib/vhost/vhost_user.c
-+++ b/lib/vhost/vhost_user.c
-@@ -2113,6 +2113,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
+diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
+index f35b6423d7..7c16d2fc12 100644
+--- a/lib/librte_vhost/vhost_user.c
++++ b/lib/librte_vhost/vhost_user.c
+@@ -1997,6 +1997,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,


More information about the stable mailing list