Thread (145 messages) 145 messages, 6 authors, 2017-07-09
STALE3311d

Revision v4 of 7 in this series.

Revisions (7)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 current
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]

[PATCH v4 11/19] devargs: parse bus policies

From: Gaetan Rivet <hidden>
Date: 2017-06-07 23:57:32
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Signed-off-by: Gaetan Rivet <redacted>
---
 lib/librte_eal/common/eal_common_devargs.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
index 8bb72a2..a5014bf 100644
--- a/lib/librte_eal/common/eal_common_devargs.c
+++ b/lib/librte_eal/common/eal_common_devargs.c
@@ -130,6 +130,21 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 
 		break;
 	}
+	if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) {
+		if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
+			bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST;
+		} else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) {
+			fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n");
+			goto fail;
+		}
+	} else if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) {
+		if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
+			bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST;
+		} else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) {
+			fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n");
+			goto fail;
+		}
+	}
 
 	free(buf);
 	TAILQ_INSERT_TAIL(&devargs_list, devargs, next);
-- 
2.1.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