DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: zero_copy incompatible with client mode
@ 2020-04-29  2:59 Xuan Ding
  2020-04-29  8:33 ` Wang, Yinan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xuan Ding @ 2020-04-29  2:59 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, xiaolong.ye; +Cc: dev, Xuan Ding

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.

Signed-off-by: Xuan Ding <xuan.ding@intel.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 7c8012179..bb8d0d780 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) {
+			VHOST_LOG_CONFIG(ERR,
+			"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.17.1


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

end of thread, other threads:[~2020-04-30  8:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  2:59 [dpdk-dev] [PATCH] vhost: zero_copy incompatible with client mode Xuan Ding
2020-04-29  8:33 ` Wang, Yinan
2020-04-29  8:46   ` Maxime Coquelin
2020-04-29 11:48 ` Maxime Coquelin
2020-04-30  8:13 ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).