[dpdk-dev,v5,07/12] eal: add virtual device arguments helper function

Message ID e619a0fca45922e0df14d8cda5cd5ab8305de05a.1491925092.git.gaetan.rivet@6wind.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Gaëtan Rivet April 11, 2017, 3:44 p.m. UTC
  From: Jan Blunck <jblunck@infradead.org>

This adds the rte_vdev_device_args() helper function to prepare for
changing the virtual drivers probe() functions take a rte_vdev_device
pointer instead of the name+args strings.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_eal/common/include/rte_vdev.h | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h
index abdefab..81f6beb 100644
--- a/lib/librte_eal/common/include/rte_vdev.h
+++ b/lib/librte_eal/common/include/rte_vdev.h
@@ -54,6 +54,14 @@  rte_vdev_device_name(const struct rte_vdev_device *dev)
 	return NULL;
 }
 
+static inline const char *
+rte_vdev_device_args(const struct rte_vdev_device *dev)
+{
+	if (dev && dev->device.devargs)
+		return dev->device.devargs->args;
+	return "";
+}
+
 /** Double linked list of virtual device drivers. */
 TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);