[dpdk-stable] patch 'vhost: prevent disabled rings to be processed with zero-copy' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Tue Apr 16 16:36:47 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

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

Kevin Traynor

---
>From 7dadea51de8e770dad51940d6a5efc347fd9b30c Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 28 Feb 2019 18:57:04 +0100
Subject: [PATCH] vhost: prevent disabled rings to be processed with zero-copy

[ upstream commit 11d5253a3e93a38be14da65328dd19960fd8cb14 ]

The vhost-user spec says that once the vring is disabled, the
client has to stop processing it. But it can happen when
dequeue zero-copy is enabled if outstanding descriptors buffers
are still being processed by an external NIC or another guest.

The fix consists in draining the zmbufs list to ensure no more
descriptors buffers are in the wild.

Note that this fix is only working in the case REPLY_ACK
protocol feature is enabled, which is not the case by default
for now (it is only enabled when IOMMU feature is enabled in
the vhost library).

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")

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

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index be4f3c6c8..2d1123e60 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1346,4 +1346,8 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,
 				index, enable);
 
+	/* On disable, rings have to be stopped being processed. */
+	if (!enable && dev->dequeue_zero_copy)
+		drain_zmbuf_list(dev->virtqueue[index]);
+
 	dev->virtqueue[index]->enabled = enable;
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-16 15:34:26.487909570 +0100
+++ 0029-vhost-prevent-disabled-rings-to-be-processed-with-ze.patch	2019-04-16 15:34:25.174180083 +0100
@@ -1,8 +1,10 @@
-From 11d5253a3e93a38be14da65328dd19960fd8cb14 Mon Sep 17 00:00:00 2001
+From 7dadea51de8e770dad51940d6a5efc347fd9b30c Mon Sep 17 00:00:00 2001
 From: Maxime Coquelin <maxime.coquelin at redhat.com>
 Date: Thu, 28 Feb 2019 18:57:04 +0100
 Subject: [PATCH] vhost: prevent disabled rings to be processed with zero-copy
 
+[ upstream commit 11d5253a3e93a38be14da65328dd19960fd8cb14 ]
+
 The vhost-user spec says that once the vring is disabled, the
 client has to stop processing it. But it can happen when
 dequeue zero-copy is enabled if outstanding descriptors buffers
@@ -17,7 +19,6 @@
 the vhost library).
 
 Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
-Cc: stable at dpdk.org
 
 Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
 Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>
@@ -26,7 +27,7 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
-index 36c0c676d..555d09ad9 100644
+index be4f3c6c8..2d1123e60 100644
 --- a/lib/librte_vhost/vhost_user.c
 +++ b/lib/librte_vhost/vhost_user.c
 @@ -1346,4 +1346,8 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,


More information about the stable mailing list