Thread (91 messages) flat view 91 messages, 7 authors, 2017-04-14
STALE3405d REVIEWED: 1 (0M)

1 review trailer.

[PATCH v3 07/10] eal: add virtual device name helper function

From: Jan Blunck <hidden>
Date: 2017-02-25 10:28:38
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>
Acked-by: Shreyansh Jain <redacted>
---
 lib/librte_eal/common/include/rte_vdev.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h
index 8f98372..abdefab 100644
--- a/lib/librte_eal/common/include/rte_vdev.h
+++ b/lib/librte_eal/common/include/rte_vdev.h
@@ -39,12 +39,21 @@ extern "C" {
 
 #include <sys/queue.h>
 #include <rte_dev.h>
+#include <rte_devargs.h>
 
 struct rte_vdev_device {
 	TAILQ_ENTRY(rte_vdev_device) next;      /**< Next attached vdev */
 	struct rte_device device;               /**< Inherit core device */
 };
 
+static inline const char *
+rte_vdev_device_name(const struct rte_vdev_device *dev)
+{
+	if (dev && dev->device.devargs)
+		return dev->device.devargs->virt.drv_name;
+	return NULL;
+}
+
 /** Double linked list of virtual device drivers. */
 TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);
 
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help