[dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

Wang, Yinan yinan.wang at intel.com
Tue May 19 09:03:09 CEST 2020


Tested-by: Wang, Yinan <yinan.wang at intel.com>

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Xuan Ding
> Sent: 2020年5月13日 10:14
> To: maxime.coquelin at redhat.com; Wang, Zhihong <zhihong.wang at intel.com>;
> Ye, Xiaolong <xiaolong.ye at intel.com>
> Cc: dev at dpdk.org; Ding, Xuan <Xuan.Ding at intel.com>; stable at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled
> 
> 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.
> 
> Cc: stable at dpdk.org
> 
> Signed-off-by: Xuan Ding <xuan.ding at intel.com>
> ---
> 
> v2:
> * Added the description of problem solved in commit log.
> ---
>  lib/librte_vhost/socket.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index
> bb8d0d780..0a66ef976 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;
> --
> 2.17.1



More information about the dev mailing list