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 5FB642C35 for ; Tue, 14 Mar 2017 12:03:05 +0100 (CET) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 9489813D13; Tue, 14 Mar 2017 11:03:05 +0000 (UTC) Received: from [10.36.116.175] (ovpn-116-175.ams2.redhat.com [10.36.116.175]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EB31Mr023840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Mar 2017 07:03:03 -0400 To: Yuanhan Liu , dev@dpdk.org References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-7-git-send-email-yuanhan.liu@linux.intel.com> Cc: Harris James R , Liu Changpeng From: Maxime Coquelin Message-ID: Date: Tue, 14 Mar 2017 12:02:59 +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-7-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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Mar 2017 11:03:05 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 06/17] vhost: introduce API to fetch negotiated 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 11:03:05 -0000 On 03/03/2017 10:51 AM, Yuanhan Liu wrote: > Signed-off-by: Yuanhan Liu > --- > lib/librte_vhost/rte_vhost_version.map | 1 + > lib/librte_vhost/rte_virtio_net.h | 1 + > lib/librte_vhost/vhost.c | 12 ++++++++++++ > 3 files changed, 14 insertions(+) > > diff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map > index b890da6..85a2796 100644 > --- a/lib/librte_vhost/rte_vhost_version.map > +++ b/lib/librte_vhost/rte_vhost_version.map > @@ -35,6 +35,7 @@ DPDK_17.05 { > rte_vhost_driver_enable_features; > rte_vhost_driver_get_features; > rte_vhost_driver_set_features; > + rte_vhost_get_negotiated_features > rte_vhost_get_vhost_memory; > > } DPDK_16.07; > diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h > index eddf0f4..e7b1599 100644 > --- a/lib/librte_vhost/rte_virtio_net.h > +++ b/lib/librte_vhost/rte_virtio_net.h > @@ -210,5 +210,6 @@ uint16_t rte_vhost_dequeue_burst(int vid, uint16_t queue_id, > struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count); > > int rte_vhost_get_vhost_memory(int vid, struct rte_vhost_memory **mem); > +uint64_t rte_vhost_get_negotiated_features(int vid); > > #endif /* _VIRTIO_NET_H_ */ > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c > index eee229a..8046aef 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -340,6 +340,18 @@ struct virtio_net * > return 0; > } > > +uint64_t > +rte_vhost_get_negotiated_features(int vid) > +{ > + struct virtio_net *dev; > + > + dev = get_device(vid); > + if (!dev) > + return -1; > + > + return dev->features; > +} Are we sure the negotiation is done when we can get the device? Maxime