bus/pci: do not reference devargs list
authorGaetan Rivet <gaetan.rivet@6wind.com>
Mon, 23 Apr 2018 23:54:45 +0000 (01:54 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 25 Apr 2018 01:58:10 +0000 (03:58 +0200)
This list should not be used by drivers.
Use the public API instead.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
drivers/bus/pci/Makefile
drivers/bus/pci/pci_common.c

index 804a198..c03722c 100644 (file)
@@ -37,6 +37,7 @@ EXPORT_MAP := rte_bus_pci_version.map
 
 CFLAGS := -I$(SRCDIR) $(CFLAGS)
 CFLAGS += -O3 $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 ifneq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),)
 SYSTEM := linux
index 2a00f36..6bed0bc 100644 (file)
@@ -45,12 +45,8 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)
 {
        struct rte_devargs *devargs;
        struct rte_pci_addr addr;
-       struct rte_bus *pbus;
 
-       pbus = rte_bus_find_by_name("pci");
-       TAILQ_FOREACH(devargs, &devargs_list, next) {
-               if (devargs->bus != pbus)
-                       continue;
+       RTE_EAL_DEVARGS_FOREACH("pci", devargs) {
                devargs->bus->parse(devargs->name, &addr);
                if (!rte_pci_addr_cmp(&dev->addr, &addr))
                        return devargs;