[dpdk-dev,05/13] bus: add configuration interface for buses
Checks
Commit Message
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 +
lib/librte_eal/common/eal_common_bus.c | 16 ++++++++++++++++
lib/librte_eal/common/include/rte_bus.h | 9 +++++++++
lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 +
4 files changed, 27 insertions(+)
@@ -206,6 +206,7 @@ DPDK_17.08 {
EXPERIMENTAL {
global:
+ rte_eal_bus_configure;
rte_eal_devargs_parse;
rte_eal_hotplug_add;
rte_eal_hotplug_remove;
@@ -64,6 +64,22 @@ rte_bus_unregister(struct rte_bus *bus)
RTE_LOG(DEBUG, EAL, "Unregistered [%s] bus.\n", bus->name);
}
+int rte_bus_configure(struct rte_bus *bus, const struct rte_bus_conf *conf)
+{
+ if (bus == NULL)
+ return -1;
+
+ /* only set bus scan policy if it was unset before */
+ if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
+ RTE_LOG(DEBUG, EAL, "Bus [%s] scan_mode=%d\n", bus->name,
+ conf->scan_mode);
+ bus->conf.scan_mode = conf->scan_mode;
+ } else if (bus->conf.scan_mode != conf->scan_mode)
+ return -1;
+
+ return 0;
+}
+
/* Scan all the buses for registered devices */
int
rte_bus_scan(void)
@@ -206,6 +206,15 @@ void rte_bus_register(struct rte_bus *bus);
void rte_bus_unregister(struct rte_bus *bus);
/**
+ * Configure a Bus instance.
+ *
+ * @param bus
+ * A pointer to a rte_bus structure describing the bus
+ * to be configured.
+ */
+int rte_bus_configure(struct rte_bus *bus, const struct rte_bus_conf *conf);
+
+/**
* Scan all the buses.
*
* @return
@@ -211,6 +211,7 @@ DPDK_17.08 {
EXPERIMENTAL {
global:
+ rte_eal_bus_configure;
rte_eal_devargs_parse;
rte_eal_hotplug_add;
rte_eal_hotplug_remove;