On Wed, Jun 10, 2020 at 01:53:57PM +0800, Jason Wang wrote: > > On 2020/6/10 下午12:15, Michael S. Tsirkin wrote: > > On Wed, Jun 10, 2020 at 11:21:50AM +0800, Jason Wang wrote: > > > On 2020/6/10 上午2:07, Michael S. Tsirkin wrote: > > > > > +/* > > > > > + * Default vhost_get_features() feature bits for existing device > > > > > types that do > > > > > + * not define their own. > > > > > + * > > > > > + * This is a workaround for existing device types, do not use this > > > > > in new vhost > > > > > + * device types. Explicitly define a list of feature bits instead. > > > > > + * > > > > > + * The following feature bits are excluded because libvhost-user > > > > > device > > > > > + * backends did not advertise them for a long time. Therefore we > > > > > cannot detect > > > > > + * their presence. Instead we assume they are always supported by > > > > > the device > > > > > + * backend: > > > > > + * VIRTIO_F_NOTIFY_ON_EMPTY > > > > > + * VIRTIO_F_ANY_LAYOUT > > > > > + * VIRTIO_F_VERSION_1 > > > > > + * VIRTIO_RING_F_INDIRECT_DESC > > > > > + * VIRTIO_RING_F_EVENT_IDX > > > > Weird. I remember that it's common for vhost-user not to set > > > > VIRTIO_RING_F_INDIRECT_DESC - they have huge queues so > > > > don't need it and inline descriptors give them better > > > > performance. > > > > > > > > So what's going on here? > > > > > > I guess one reason is to support live migration between vhost-user and > > > vhost-net. > > > > > > Thanks > > > > > But how can we force-enable features backend doesn't want to enable? > > > We can't and the code just forces qemu to validate > VIRTIO_RING_F_INDIRECT_DESC for each vhost backends instead of assuming the > support silently. > > Thanks
So why does the comment above say: Instead we assume they are always supported by the device backend > > > This may or may not break backends ... > > I would rather just be strict and ask backends to fix their feature > > bits. See user_feature_bits in hw/net/vhost-net.c which supports > > all these features. > >