[PATCH v2 7/8] eal: add virtual device name helper function
From: Jan Blunck <hidden>
Date: 2017-02-20 14:18:55
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
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 <redacted> --- 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