From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFABA81F01; Tue, 14 Mar 2017 10:43:50 +0000 (UTC) Received: from [10.36.116.175] (ovpn-116-175.ams2.redhat.com [10.36.116.175]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EAhkq9002170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Mar 2017 06:43:48 -0400 To: Yuanhan Liu , dev@dpdk.org References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-4-git-send-email-yuanhan.liu@linux.intel.com> Cc: Harris James R , Liu Changpeng From: Maxime Coquelin Message-ID: Date: Tue, 14 Mar 2017 11:43:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1488534682-3494-4-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 14 Mar 2017 10:43:50 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 03/17] vhost: use new APIs to handle features X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2017 10:43:51 -0000 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