pci: use new address comparison function
authorGaetan Rivet <gaetan.rivet@6wind.com>
Thu, 26 Oct 2017 10:06:01 +0000 (12:06 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Oct 2017 21:17:31 +0000 (23:17 +0200)
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/bsdapp/eal/eal_pci.c
lib/librte_eal/common/eal_common_pci.c
lib/librte_eal/common/eal_common_pci_uio.c
lib/librte_eal/linuxapp/eal/eal_pci.c
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c

index 1595988..7d82195 100644 (file)
@@ -323,7 +323,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
                int ret;
 
                TAILQ_FOREACH(dev2, &rte_pci_bus.device_list, next) {
-                       ret = rte_eal_compare_pci_addr(&dev->addr, &dev2->addr);
+                       ret = rte_pci_addr_cmp(&dev->addr, &dev2->addr);
                        if (ret > 0)
                                continue;
                        else if (ret < 0) {
index 70729d2..e4e42f5 100644 (file)
@@ -81,7 +81,7 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)
                if (devargs->bus != pbus)
                        continue;
                devargs->bus->parse(devargs->name, &addr);
-               if (!rte_eal_compare_pci_addr(&dev->addr, &addr))
+               if (!rte_pci_addr_cmp(&dev->addr, &addr))
                        return devargs;
        }
        return NULL;
@@ -194,7 +194,7 @@ rte_pci_addr_cmp(const struct rte_pci_addr *addr,
 
 int
 rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
-                          const struct rte_pci_addr *addr2)
+                        const struct rte_pci_addr *addr2)
 {
        return rte_pci_addr_cmp(addr, addr2);
 }
@@ -467,7 +467,7 @@ rte_pci_probe_one(const struct rte_pci_addr *addr)
                goto err_return;
 
        FOREACH_DEVICE_ON_PCIBUS(dev) {
-               if (rte_eal_compare_pci_addr(&dev->addr, addr))
+               if (rte_pci_addr_cmp(&dev->addr, addr))
                        continue;
 
                ret = pci_probe_all_drivers(dev);
@@ -497,7 +497,7 @@ rte_pci_detach(const struct rte_pci_addr *addr)
                return -1;
 
        FOREACH_DEVICE_ON_PCIBUS(dev) {
-               if (rte_eal_compare_pci_addr(&dev->addr, addr))
+               if (rte_pci_addr_cmp(&dev->addr, addr))
                        continue;
 
                ret = rte_pci_detach_dev(dev);
index 367a681..9df3833 100644 (file)
@@ -61,7 +61,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)
        TAILQ_FOREACH(uio_res, uio_res_list, next) {
 
                /* skip this element if it doesn't match our PCI address */
-               if (rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
+               if (rte_pci_addr_cmp(&uio_res->pci_addr, &dev->addr))
                        continue;
 
                for (i = 0; i != uio_res->nb_maps; i++) {
@@ -187,7 +187,7 @@ pci_uio_find_resource(struct rte_pci_device *dev)
        TAILQ_FOREACH(uio_res, uio_res_list, next) {
 
                /* skip this element if it doesn't match our PCI address */
-               if (!rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
+               if (!rte_pci_addr_cmp(&uio_res->pci_addr, &dev->addr))
                        return uio_res;
        }
        return NULL;
index dc65852..3a853a6 100644 (file)
@@ -363,7 +363,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
                int ret;
 
                TAILQ_FOREACH(dev2, &rte_pci_bus.device_list, next) {
-                       ret = rte_eal_compare_pci_addr(&dev->addr, &dev2->addr);
+                       ret = rte_pci_addr_cmp(&dev->addr, &dev2->addr);
                        if (ret > 0)
                                continue;
 
index 19994c8..3331b13 100644 (file)
@@ -576,8 +576,8 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)
 
        /* if we're in a secondary process, just find our tailq entry */
        TAILQ_FOREACH(vfio_res, vfio_res_list, next) {
-               if (rte_eal_compare_pci_addr(&vfio_res->pci_addr,
-                                                &dev->addr))
+               if (rte_pci_addr_cmp(&vfio_res->pci_addr,
+                                    &dev->addr))
                        continue;
                break;
        }