All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: Clean iotlb cache on vring stop
@ 2021-08-27 16:12 Eugenio Pérez
  2021-08-30 11:57 ` Xia, Chenbo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Eugenio Pérez @ 2021-08-27 16:12 UTC (permalink / raw)
  To: Maxime Coquelin, Chenbo Xia; +Cc: dev, Pei Zhang, Jason Wang

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.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reported-by: Pei Zhang <pezhang@redhat.com>
---
 lib/vhost/vhost_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 29a4c9af60..7de48f5333 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,
 	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.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-09-28 15:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 16:12 [dpdk-dev] [PATCH] vhost: Clean iotlb cache on vring stop Eugenio Pérez
2021-08-30 11:57 ` Xia, Chenbo
2021-08-30 18:10   ` Eugenio Perez Martin
2021-08-31  2:02     ` Xia, Chenbo
2021-08-31  7:10       ` Eugenio Perez Martin
2021-09-23  8:34 ` Maxime Coquelin
2021-09-23  8:48   ` Xia, Chenbo
2021-09-23  8:50     ` Maxime Coquelin
2021-09-23  8:54       ` Xia, Chenbo
2021-09-28 15:29 ` Maxime Coquelin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.