From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 2BB421094 for ; Thu, 23 Mar 2017 08:13:09 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 23 Mar 2017 00:13:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,208,1486454400"; d="scan'208";a="837675338" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by FMSMGA003.fm.intel.com with ESMTP; 23 Mar 2017 00:13:07 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Harris James R , Liu Changpeng , Yuanhan Liu Date: Thu, 23 Mar 2017 15:10:43 +0800 Message-Id: <1490253059-28112-7-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1490253059-28112-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1490253059-28112-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 06/22] 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: Thu, 23 Mar 2017 07:13:09 -0000 Signed-off-by: Yuanhan Liu --- lib/librte_vhost/rte_vhost_version.map | 2 ++ lib/librte_vhost/rte_virtio_net.h | 10 ++++++++++ lib/librte_vhost/vhost.c | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map index 664a5f3..e21b788 100644 --- a/lib/librte_vhost/rte_vhost_version.map +++ b/lib/librte_vhost/rte_vhost_version.map @@ -37,5 +37,7 @@ DPDK_17.05 { rte_vhost_driver_set_features; rte_vhost_get_mem_table; rte_vhost_get_mtu; + 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 5a91f97..57e57e3 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -154,6 +154,16 @@ struct virtio_net_device_ops { */ uint64_t rte_vhost_driver_get_features(const char *path); +/** + * Get the feature bits after negotiation + * + * @param vid + * Vhost device ID + * @return + * Negotiated feature bits on success, 0 on failure + */ +uint64_t rte_vhost_get_negotiated_features(int vid); + /* Register callbacks. */ int rte_vhost_driver_callback_register(const char *path, struct virtio_net_device_ops const * const ops); diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 2b41652..08dccfb 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -359,6 +359,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 0; + + return dev->features; +} + int rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem) { -- 1.9.0