> -----Original Message----- > From: Bie, Tiwei > Sent: Thursday, April 5, 2018 4:29 PM > To: Yang, Zhiyong <zhiyong.y...@intel.com> > Cc: dev@dpdk.org; maxime.coque...@redhat.com; tho...@monjalon.net; > Tan, Jianfeng <jianfeng....@intel.com>; Wang, Zhihong > <zhihong.w...@intel.com>; Wang, Dong1 <dong1.w...@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.y...@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