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: 715070ea10 ("vhost: prevent zero-copy with incompatible client mode")
Cc: stable@dpdk.org

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
This commit is contained in:
Xuan Ding 2020-05-19 10:15:46 +00:00 committed by Ferruh Yigit
parent 5ea6142543
commit 22fa1bcbcb

View File

@ -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;