On 03/03/2017 10:51 AM, Yuanhan Liu wrote:
Signed-off-by: Yuanhan Liu <yuanhan....@linux.intel.com>
---
 examples/tep_termination/main.c        |  4 +++-
 examples/vhost/main.c                  | 43 +++++++++++++++++++++-------------
 lib/librte_vhost/rte_vhost_version.map |  3 ---
 lib/librte_vhost/rte_virtio_net.h      | 13 ----------
 lib/librte_vhost/socket.c              | 23 +++++++++++++++++-
 lib/librte_vhost/vhost.c               | 41 --------------------------------
 lib/librte_vhost/vhost.h               | 20 ++++++++++++++++
 lib/librte_vhost/vhost_user.c          |  8 +++----
 8 files changed, 76 insertions(+), 79 deletions(-)


</snip>


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.

Maxime

Reply via email to