[dpdk-stable] patch 'vhost: prevent zero-copy with incompatible client mode' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:37 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. 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 a6ae060e3995d8157b363155f88e39e6a67bbd63 Mon Sep 17 00:00:00 2001
From: Xuan Ding <xuan.ding at intel.com>
Date: Wed, 29 Apr 2020 02:59:46 +0000
Subject: [PATCH] vhost: prevent zero-copy with incompatible client mode

[ upstream commit 715070ea10e6da1169deef2a3ea77ae934b4c333 ]

In server mode, virtio-user inits under the assumption that vhost-user
supports a list of features. However, this could be problematic when
in_order feature is negotiated but not supported by vhost-user when
enables dequeue_zero_copy later.

Add handling when vhost-user enables dequeue_zero_copy as client.

Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode")

Signed-off-by: Xuan Ding <xuan.ding at intel.com>
Tested-by: Yinan Wang <yinan.wang at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/socket.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index c9322707e7..8a87c38c4e 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -926,6 +926,12 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
+		if (!vsocket->is_server) {
+			RTE_LOG(ERR, VHOST_CONFIG,
+			"error: zero copy is incompatible with vhost client mode\n");
+			ret = -1;
+			goto out_mutex;
+		}
 		vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 		vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:50.221520306 +0100
+++ 0142-vhost-prevent-zero-copy-with-incompatible-client-mod.patch	2020-05-19 14:04:44.456652723 +0100
@@ -1,8 +1,10 @@
-From 715070ea10e6da1169deef2a3ea77ae934b4c333 Mon Sep 17 00:00:00 2001
+From a6ae060e3995d8157b363155f88e39e6a67bbd63 Mon Sep 17 00:00:00 2001
 From: Xuan Ding <xuan.ding at intel.com>
 Date: Wed, 29 Apr 2020 02:59:46 +0000
 Subject: [PATCH] vhost: prevent zero-copy with incompatible client mode
 
+[ upstream commit 715070ea10e6da1169deef2a3ea77ae934b4c333 ]
+
 In server mode, virtio-user inits under the assumption that vhost-user
 supports a list of features. However, this could be problematic when
 in_order feature is negotiated but not supported by vhost-user when
@@ -11,7 +13,6 @@
 Add handling when vhost-user enables dequeue_zero_copy as client.
 
 Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode")
-Cc: stable at dpdk.org
 
 Signed-off-by: Xuan Ding <xuan.ding at intel.com>
 Tested-by: Yinan Wang <yinan.wang at intel.com>
@@ -21,7 +22,7 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
-index 7c80121790..bb8d0d7801 100644
+index c9322707e7..8a87c38c4e 100644
 --- a/lib/librte_vhost/socket.c
 +++ b/lib/librte_vhost/socket.c
 @@ -926,6 +926,12 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
@@ -29,7 +30,7 @@
  			goto out_mutex;
  		}
 +		if (!vsocket->is_server) {
-+			VHOST_LOG_CONFIG(ERR,
++			RTE_LOG(ERR, VHOST_CONFIG,
 +			"error: zero copy is incompatible with vhost client mode\n");
 +			ret = -1;
 +			goto out_mutex;


More information about the stable mailing list