[dpdk-dev,v2,7/8] eal: add virtual device name helper function
Checks
Commit Message
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 <jblunck@infradead.org>
---
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(+)
Comments
On 2/20/2017 2:17 PM, Jan Blunck wrote:
> 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 <jblunck@infradead.org>
<...>
> +const char *
> +rte_vdev_device_name(const struct rte_vdev_device *dev)
> +{
> + return dev->device.devargs->virt.drv_name;
> +}
Can this function be static?
@@ -184,3 +184,9 @@ DPDK_17.02 {
rte_bus_unregister;
} DPDK_16.11;
+
+DPDK_17.05 {
+ global:
+
+ rte_vdev_device_name;
+} DPDK_17.02;
@@ -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)
{
@@ -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);