[dpdk-dev,v2,13/18] bus: make device recognition function public

Message ID 5119c935da0c88362e761a9a8e23c3539778e125.1507796100.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Gaëtan Rivet Oct. 12, 2017, 8:21 a.m. UTC
  As other EAL facilities now requires the bus to be explicitly mentioned,
the function rte_bus_find_by_device_name can be used by third parties to
ease the transition to a more formal device definition scheme.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 +
 lib/librte_eal/common/include/rte_bus.h         | 12 ++++++++++++
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 3 files changed, 14 insertions(+)
  

Patch

diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index 0d693c8..13c8450 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -223,6 +223,7 @@  EXPERIMENTAL {
 DPDK_17.11 {
 	global:
 
+	rte_bus_find_by_device_name;
 	rte_bus_get_iommu_class;
 	rte_eal_iova_mode;
 	rte_eal_mbuf_default_mempool_ops;
diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
index 1cae96e..6d3fb70 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -364,6 +364,18 @@  struct rte_bus *rte_bus_find_by_device(const struct rte_device *dev);
 struct rte_bus *rte_bus_find_by_name(const char *busname);
 
 /**
+ * Find a bus capable of identifying a device.
+ *
+ * @param str
+ *   A device identifier (PCI address, virtual PMD name, ...).
+ *
+ * @return
+ *   A valid bus handle if found.
+ *   NULL if no bus is able to parse this device.
+ */
+struct rte_bus *rte_bus_find_by_device_name(const char *str);
+
+/**
  * Helper for Bus registration.
  * The constructor has higher priority than PMD constructors.
  */
diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
index 9c0251e..a6fe25c 100644
--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
@@ -227,6 +227,7 @@  EXPERIMENTAL {
 DPDK_17.11 {
 	global:
 
+	rte_bus_find_by_device_name;
 	rte_bus_get_iommu_class;
 	rte_eal_iova_mode;
 	rte_eal_mbuf_default_mempool_ops;