[dpdk-dev] [PATCH v5] net/virtio-user: add support for server mode

Yang, Zhiyong zhiyong.yang at intel.com
Fri Apr 6 09:22:35 CEST 2018



> -----Original Message-----
> From: Bie, Tiwei
> Sent: Thursday, April 5, 2018 4:29 PM
> To: Yang, Zhiyong <zhiyong.yang at intel.com>
> Cc: dev at dpdk.org; maxime.coquelin at redhat.com; thomas at monjalon.net;
> Tan, Jianfeng <jianfeng.tan at intel.com>; Wang, Zhihong
> <zhihong.wang at intel.com>; Wang, Dong1 <dong1.wang at intel.com>
> Subject: Re: [PATCH v5] net/virtio-user: add support for server mode
> 
> On Thu, Apr 05, 2018 at 01:17:53AM +0800, zhiyong.yang at intel.com wrote:

<snip>

> > @@ -337,16 +343,21 @@ virtio_user_dev_init(struct virtio_user_dev *dev,
> char *path, int queues,
> >  		return -1;
> >  	}
> >
> > -	if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL)
> < 0) {
> > -		PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno));
> > -		return -1;
> > -	}
> > +	if (dev->vhostfd >= 0) {
> > +		if (dev->ops->send_request(dev,
> VHOST_USER_SET_OWNER, NULL) < 0) {
> > +			PMD_INIT_LOG(ERR, "set_owner fails: %s",
> strerror(errno));
> > +			return -1;
> > +		}
> >
> > -	if (dev->ops->send_request(dev, VHOST_USER_GET_FEATURES,
> > -			    &dev->device_features) < 0) {
> > -		PMD_INIT_LOG(ERR, "get_features failed: %s",
> strerror(errno));
> > -		return -1;
> > +		if (dev->ops->send_request(dev,
> VHOST_USER_GET_FEATURES,
> > +				&dev->device_features) < 0) {
> > +			PMD_INIT_LOG(ERR, "get_features failed: %s",
> strerror(errno));
> > +			return -1;
> > +		}
> > +	} else {
> > +		dev->device_features =
> VIRTIO_USER_SUPPORTED_FEATURES;
> 
> If the backend doesn't support e.g. VIRTIO_RING_F_INDIRECT_DESC.
> Will it cause any problem?
> 
vhost-user will compare virtio-user and vhost-user features, as you said that
if VIRTIO_RING_F_INDIRECT_DESC was not supported ,
vhost-user come across failure. vhost-user closes the connecting socket and later virtio-user will detect the
broken connection by LSC. 

thanks
zhiyong


More information about the dev mailing list