From: Xuan Ding Date: Tue, 19 May 2020 10:15:46 +0000 (+0000) Subject: vhost: fix zero-copy server mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=22fa1bcbcbc7489304a711c39aea9a1593a873a5;p=dpdk.git vhost: fix zero-copy server mode This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled. Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time. Fixes: 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode") Cc: stable@dpdk.org Signed-off-by: Xuan Ding Acked-by: Xiaolong Ye Tested-by: Yinan Wang --- diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index bb8d0d7801..0a66ef9767 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags) ret = -1; goto out_mutex; } - if (!vsocket->is_server) { + if ((flags & RTE_VHOST_USER_CLIENT) != 0) { VHOST_LOG_CONFIG(ERR, "error: zero copy is incompatible with vhost client mode\n"); ret = -1;