[dpdk-dev] [PATCH 03/17] vhost: use new APIs to handle features

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu Mar 16 08:43:11 CET 2017


On Tue, Mar 14, 2017 at 11:43:44AM +0100, Maxime Coquelin wrote:
> >diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> >index 8433a54..f7227bf 100644
> >--- a/lib/librte_vhost/vhost_user.c
> >+++ b/lib/librte_vhost/vhost_user.c
> >@@ -143,9 +143,9 @@
> >  * The features that we support are requested.
> >  */
> > static uint64_t
> >-vhost_user_get_features(void)
> >+vhost_user_get_features(struct virtio_net *dev)
> > {
> >-	return VHOST_FEATURES;
> >+	return rte_vhost_driver_get_features(dev->ifname);
> > }
> >
> > /*
> >@@ -154,7 +154,7 @@
> > static int
> > vhost_user_set_features(struct virtio_net *dev, uint64_t features)
> > {
> >-	if (features & ~VHOST_FEATURES)
> >+	if (features & ~rte_vhost_driver_get_features(dev->ifname))
> 
> rte_vhost_driver_get_features() returns -1 if the socket is not found.
> It would result in accepting any feature trying to be set.

If we have gone here, I think rte_vhost_driver_get_features() should not
return -1. The only exception is user unregistered such socket during
the negotiation?

	--yliu


More information about the dev mailing list