vhost: zero_copy incompatible with client mode
PATCH 1/1 vhost: zero_copy incompatible with client mode
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.
--- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)
lib/librte_vhost/socket.c +6 -0
@@ -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 );
Signature · 1 line
2.17.1
Quoted 42 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Xuan Ding
Sent: 2020年4月29日 11:00
To: [email protected]; Wang, Zhihong <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>
Subject: [dpdk-dev] [PATCH] vhost:zero_copyincompatible with client modeIn server mode, virtio-user inits under the assumption that vhost-user supports a list of features. However, this could be problematic when
in_orderfeature is negotiated but not supported by vhost-user when enablesdequeue_zero_copylater.Add handling when vhost-user enables
dequeue_zero_copyas client.Signed-off-by Xuan Ding <[email protected]>--- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/librte_vhost/socket.c index renamed from lib/librte_vhost/socket.c +0
-0
7c8012179..bb8d0d780100644lib/librte_vhost/socket.c +6
-0@@ -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
Hi Yinan,
Quoted 1 line · Yinan
Tested-by Yinan Wang <[email protected]>
Thanks for running tests on Vhost patches, that's much appreciated.
Could you provide more information on the test run?
Does it consist in reproducing the issue the patch is aiming to fix, apply patch and check issue is fixed?
Or does it consist in running a generic Vhost/Virtio test suite?
Regards,
Maxime
Quoted 43 lines
Quoted 42 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Xuan Ding
Sent: 2020年4月29日 11:00
To: [email protected]; Wang, Zhihong <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>
Subject: [dpdk-dev] [PATCH] vhost:zero_copyincompatible with client modeIn server mode, virtio-user inits under the assumption that vhost-user supports a list of features. However, this could be problematic when
in_orderfeature is negotiated but not supported by vhost-user when enablesdequeue_zero_copylater.Add handling when vhost-user enables
dequeue_zero_copyas client.Signed-off-by Xuan Ding <[email protected]>--- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/librte_vhost/socket.c index renamed from lib/librte_vhost/socket.c +0
-0
7c8012179..bb8d0d780100644lib/librte_vhost/socket.c +6
-0@@ -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
Quoted 11 lines · 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_orderfeature is negotiated but not supported by vhost-user when enablesdequeue_zero_copylater.Add handling when vhost-user enables
dequeue_zero_copyas client.Signed-off-by Xuan Ding <[email protected]>--- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 11 lines · 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_orderfeature is negotiated but not supported by vhost-user when enablesdequeue_zero_copylater.Add handling when vhost-user enables
dequeue_zero_copyas client.Signed-off-by Xuan Ding <[email protected]>--- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime