[dpdk-dev,v2,09/14] bus: introduce bus scan policies

Message ID 20c15d2d9705f45a2bb2abbd0c07e1478811777a.1495642399.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Gaëtan Rivet May 24, 2017, 4:16 p.m. UTC
  Scan policies describe the way a bus should scan the system to search
for possible devices.

Three flags are introduced:
  RTE_BUS_SCAN_UNDEFINED: Configuration is irrelevant for this bus
  RTE_BUS_SCAN_WHITELIST: Scanning should be limited to declared devices
  RTE_BUS_SCAN_BLACKLIST: Scanning should exclude only declared devices

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/include/rte_bus.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Patch

diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
index 0b48e66..fa08454 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -123,6 +123,22 @@  typedef int (*rte_bus_detach_t)(struct rte_device *dev);
 typedef int (*rte_bus_parse_t)(const char *name, void *addr);
 
 /**
+ * Bus scan policies
+ */
+enum rte_bus_scan_mode {
+	RTE_BUS_SCAN_UNDEFINED,
+	RTE_BUS_SCAN_WHITELIST,
+	RTE_BUS_SCAN_BLACKLIST,
+};
+
+/**
+ * A structure used to configure bus operations.
+ */
+struct rte_bus_conf {
+	enum rte_bus_scan_mode scan_mode; /**< Scan policy. */
+};
+
+/**
  * A structure describing a generic bus.
  */
 struct rte_bus {
@@ -134,6 +150,7 @@  struct rte_bus {
 	rte_bus_attach_t attach;     /**< Probe single device for drivers */
 	rte_bus_detach_t detach;     /**< Remove single device from driver */
 	rte_bus_parse_t parse;       /**< Parse a device name */
+	struct rte_bus_conf conf;    /**< Bus configuration */
 };
 
 /**