From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 03/17] vhost: use new APIs to handle features Date: Tue, 14 Mar 2017 11:43:44 +0100 Message-ID: References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-4-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Harris James R , Liu Changpeng To: Yuanhan Liu , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D5804695C for ; Tue, 14 Mar 2017 11:43:50 +0100 (CET) In-Reply-To: <1488534682-3494-4-git-send-email-yuanhan.liu@linux.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/03/2017 10:51 AM, Yuanhan Liu wrote: > Signed-off-by: Yuanhan Liu > --- > 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(-) > > > 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