1 diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
2 index bb634c6..7c65dda 100644
3 --- a/drivers/net/bonding/rte_eth_bond_args.c
4 +++ b/drivers/net/bonding/rte_eth_bond_args.c
8 for (i = 0; i < rte_eth_dev_count(); i++) {
10 - /* Currently populated by rte_eth_copy_pci_info().
12 - * TODO: Once the PCI bus has arrived we should have a better
13 - * way to test for being a PCI device or not.
15 - if (rte_eth_devices[i].data->kdrv == RTE_KDRV_UNKNOWN ||
16 - rte_eth_devices[i].data->kdrv == RTE_KDRV_NONE)
19 pci_dev = RTE_ETH_DEV_TO_PCI(&rte_eth_devices[i]);
20 eth_pci_addr = &pci_dev->addr;
27 +pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)
29 + struct rte_pci_device *pdev;
30 + const struct rte_pci_addr *paddr = _pci_addr;
32 + pdev = RTE_DEV_TO_PCI(*(struct rte_device **)(void *)&dev);
33 + return rte_eal_compare_pci_addr(&pdev->addr, paddr);
37 * Parses a port identifier string to a port id by pci address, then by name,
38 * and finally port id.
40 parse_port_id(const char *port_str)
42 struct rte_pci_addr dev_addr;
43 + struct rte_bus *pci_bus;
44 + struct rte_device *dev;
47 + pci_bus = rte_bus_find_by_name("pci");
48 + if (pci_bus == NULL) {
49 + RTE_LOG(ERR, PMD, "unable to find PCI bus\n");
53 /* try parsing as pci address, physical devices */
54 - if (eal_parse_pci_DomBDF(port_str, &dev_addr) == 0) {
55 + if (pci_bus->parse(port_str, &dev_addr) == 0) {
56 + dev = pci_bus->find_device(NULL, pci_addr_cmp, &dev_addr);
58 + RTE_LOG(ERR, PMD, "unable to find PCI device\n");
61 port_id = find_port_id_by_pci_addr(&dev_addr);