Imported Upstream version 17.05
[deb_dpdk.git] / drivers / net / bonding / rte_eth_bond_args.c
index 02ecde6..e3bdad9 100644 (file)
@@ -47,22 +47,30 @@ const char *pmd_bond_init_valid_arguments[] = {
        PMD_BOND_XMIT_POLICY_KVARG,
        PMD_BOND_SOCKET_ID_KVARG,
        PMD_BOND_MAC_ADDR_KVARG,
-
+       "driver",
        NULL
 };
 
 static inline int
 find_port_id_by_pci_addr(const struct rte_pci_addr *pci_addr)
 {
+       struct rte_pci_device *pci_dev;
        struct rte_pci_addr *eth_pci_addr;
        unsigned i;
 
        for (i = 0; i < rte_eth_dev_count(); i++) {
 
-               if (rte_eth_devices[i].pci_dev == NULL)
+               /* Currently populated by rte_eth_copy_pci_info().
+                *
+                * TODO: Once the PCI bus has arrived we should have a better
+                * way to test for being a PCI device or not.
+                */
+               if (rte_eth_devices[i].data->kdrv == RTE_KDRV_UNKNOWN ||
+                   rte_eth_devices[i].data->kdrv == RTE_KDRV_NONE)
                        continue;
 
-               eth_pci_addr = &(rte_eth_devices[i].pci_dev->addr);
+               pci_dev = RTE_DEV_TO_PCI(rte_eth_devices[i].device);
+               eth_pci_addr = &pci_dev->addr;
 
                if (pci_addr->bus == eth_pci_addr->bus &&
                        pci_addr->devid == eth_pci_addr->devid &&