[v4] vhost: fix zero-copy cannot be enabled
Checks
Commit Message
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")
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>
---
v4:
* Added in reply to the first Message Id.
v3:
* Removed Cc to stable and added fixes label.
v2:
* Added the description of problem solved in commit log.
---
lib/librte_vhost/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 5/19/2020 11:15 AM, Xuan Ding wrote:
> 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")
>
> 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>
Applied to dpdk-next-net/master, thanks.
@@ -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;