[dpdk-dev] [PATCH] vhost: zero_copy incompatible with client mode

Wang, Yinan yinan.wang at intel.com
Wed Apr 29 10:33:29 CEST 2020


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

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Xuan Ding
> Sent: 2020年4月29日 11:00
> 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>
> Subject: [dpdk-dev] [PATCH] 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.
> 
> Signed-off-by: Xuan Ding <xuan.ding at intel.com>
> ---
>  lib/librte_vhost/socket.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index
> 7c8012179..bb8d0d780 100644
> --- a/lib/librte_vhost/socket.c
> +++ b/lib/librte_vhost/socket.c
> @@ -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



More information about the dev mailing list