From: Olivier Matz Date: Fri, 28 Feb 2014 17:25:44 +0000 (+0100) Subject: pci: rename device and driver lists X-Git-Tag: spdx-start~10899 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5b1f4a67dd5bcfa8d5139c064ced6e37a9149419;p=dpdk.git pci: rename device and driver lists To avoid confusion with virtual devices, rename device_list as pci_device_list and driver_list as pci_driver_list. Signed-off-by: Olivier Matz Acked-by: Thomas Monjalon --- diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 64b13c1120..e290c0c6ed 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -131,7 +131,7 @@ blacklist_all_devices(void) memset(blacklist, 0, sizeof (blacklist)); - TAILQ_FOREACH(dev, &device_list, next) { + TAILQ_FOREACH(dev, &pci_device_list, next) { if (idx >= sizeof (blacklist) / sizeof (blacklist[0])) { printf("Error: too many devices to blacklist"); break; diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 9c9e842545..59a68d48fc 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -80,8 +80,8 @@ #include "eal_private.h" -struct pci_driver_list driver_list; -struct pci_device_list device_list; +struct pci_driver_list pci_driver_list; +struct pci_device_list pci_device_list; static struct rte_pci_addr *dev_blacklist = NULL; static unsigned dev_blacklist_size = 0; @@ -119,7 +119,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev) int rc; dev->blacklisted = !!is_blacklisted(dev); - TAILQ_FOREACH(dr, &driver_list, next) { + TAILQ_FOREACH(dr, &pci_driver_list, next) { rc = rte_eal_pci_probe_one_driver(dr, dev); if (rc < 0) /* negative value is an error */ @@ -165,7 +165,7 @@ rte_eal_pci_probe(void) { struct rte_pci_device *dev = NULL; - TAILQ_FOREACH(dev, &device_list, next) + TAILQ_FOREACH(dev, &pci_device_list, next) if (!eal_dev_whitelist_exists()) pci_probe_all_drivers(dev); else if (pcidev_is_whitelisted(dev) && pci_probe_all_drivers(dev) < 0 ) @@ -202,7 +202,7 @@ rte_eal_pci_dump(void) { struct rte_pci_device *dev = NULL; - TAILQ_FOREACH(dev, &device_list, next) { + TAILQ_FOREACH(dev, &pci_device_list, next) { pci_dump_one_device(dev); } } @@ -211,14 +211,14 @@ rte_eal_pci_dump(void) void rte_eal_pci_register(struct rte_pci_driver *driver) { - TAILQ_INSERT_TAIL(&driver_list, driver, next); + TAILQ_INSERT_TAIL(&pci_driver_list, driver, next); } /* unregister a driver */ void rte_eal_pci_unregister(struct rte_pci_driver *driver) { - TAILQ_REMOVE(&driver_list, driver, next); + TAILQ_REMOVE(&pci_driver_list, driver, next); } void diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 9d4f94f9ea..fa588dee54 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -85,8 +85,8 @@ extern "C" { TAILQ_HEAD(pci_device_list, rte_pci_device); /**< PCI devices in D-linked Q. */ TAILQ_HEAD(pci_driver_list, rte_pci_driver); /**< PCI drivers in D-linked Q. */ -extern struct pci_driver_list driver_list; /**< Global list of PCI drivers. */ -extern struct pci_device_list device_list; /**< Global list of PCI devices. */ +extern struct pci_driver_list pci_driver_list; /**< Global list of PCI drivers. */ +extern struct pci_device_list pci_device_list; /**< Global list of PCI devices. */ /** Pathname of PCI devices directory. */ #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices" diff --git a/lib/librte_eal/linuxapp/eal/eal_ivshmem.c b/lib/librte_eal/linuxapp/eal/eal_ivshmem.c index 6191fefdd5..87e88c3453 100644 --- a/lib/librte_eal/linuxapp/eal/eal_ivshmem.c +++ b/lib/librte_eal/linuxapp/eal/eal_ivshmem.c @@ -854,7 +854,7 @@ int rte_eal_ivshmem_init(void) } else { - TAILQ_FOREACH(dev, &device_list, next) { + TAILQ_FOREACH(dev, &pci_device_list, next) { if (is_ivshmem_device(dev)) { diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 5fa466ef88..f4ac8f4e83 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -888,13 +888,13 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, } /* device is valid, add in list (sorted) */ - if (TAILQ_EMPTY(&device_list)) { - TAILQ_INSERT_TAIL(&device_list, dev, next); + if (TAILQ_EMPTY(&pci_device_list)) { + TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } else { struct rte_pci_device *dev2 = NULL; - TAILQ_FOREACH(dev2, &device_list, next) { + TAILQ_FOREACH(dev2, &pci_device_list, next) { if (pci_addr_comparison(&dev->addr, &dev2->addr)) continue; else { @@ -902,7 +902,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, return 0; } } - TAILQ_INSERT_TAIL(&device_list, dev, next); + TAILQ_INSERT_TAIL(&pci_device_list, dev, next); } return 0; @@ -1068,8 +1068,8 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d int rte_eal_pci_init(void) { - TAILQ_INIT(&driver_list); - TAILQ_INIT(&device_list); + TAILQ_INIT(&pci_driver_list); + TAILQ_INIT(&pci_device_list); uio_res_list = RTE_TAILQ_RESERVE_BY_IDX(RTE_TAILQ_PCI, uio_res_list); /* for debug purposes, PCI can be disabled */