pci: use new address comparison function

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
This commit is contained in:
Gaetan Rivet 2017-10-26 12:06:01 +02:00 committed by Thomas Monjalon
parent 1a2d1f62d7
commit 102afb4067
5 changed files with 10 additions and 10 deletions

View 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) {

View 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);

View 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;

View 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;

View 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;
}