From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: [PATCH v2 7/8] eal: add virtual device name helper function Date: Mon, 20 Feb 2017 15:17:41 +0100 Message-ID: <1487600262-14382-8-git-send-email-jblunck@infradead.org> References: <1487600262-14382-1-git-send-email-jblunck@infradead.org> Cc: david.marchand@6wind.com, shreyansh.jain@nxp.com, ferruh.yigit@intel.com To: dev@dpdk.org Return-path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id B9FBCF92F for ; Mon, 20 Feb 2017 15:18:55 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id s27so2978612wrb.0 for ; Mon, 20 Feb 2017 06:18:55 -0800 (PST) In-Reply-To: <1487600262-14382-1-git-send-email-jblunck@infradead.org> In-Reply-To: <1487152929-23627-1-git-send-email-jblunck@infradead.org> References: <1487152929-23627-1-git-send-email-jblunck@infradead.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This adds the rte_vdev_device_name() helper function to retrieve the rte_vdev_device name which makes moving the name of the low-level device into struct rte_device easier in the future. Signed-off-by: Jan Blunck --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 6 ++++++ lib/librte_eal/common/eal_common_vdev.c | 6 ++++++ lib/librte_eal/common/include/rte_vdev.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 0116085..4afa1c5 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -184,3 +184,9 @@ DPDK_17.02 { rte_bus_unregister; } DPDK_16.11; + +DPDK_17.05 { + global: + + rte_vdev_device_name; +} DPDK_17.02; diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 61677de..a9798d0 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -66,6 +66,12 @@ rte_eal_vdrv_unregister(struct rte_vdev_driver *driver) TAILQ_REMOVE(&vdev_driver_list, driver, next); } +const char * +rte_vdev_device_name(const struct rte_vdev_device *dev) +{ + return dev->device.devargs->virt.drv_name; +} + static int vdev_probe_all_drivers(const char *name, const char *args) { diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 8f98372..ffa48bd 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -45,6 +45,8 @@ struct rte_vdev_device { struct rte_device device; /**< Inherit core device */ }; +const char *rte_vdev_device_name(const struct rte_vdev_device *dev); + /** Double linked list of virtual device drivers. */ TAILQ_HEAD(vdev_driver_list, rte_vdev_driver); -- 2.7.4