net/bonding: use local prefix namespace
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal_pci.c
index dcb3b51..e73b7cd 100644 (file)
@@ -280,8 +280,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
        /* FreeBSD has no NUMA support (yet) */
        dev->device.numa_node = 0;
 
-       rte_pci_device_name(&dev->addr, dev->name, sizeof(dev->name));
-       dev->device.name = dev->name;
+       pci_name_set(dev);
 
        /* FreeBSD has only one pass through driver */
        dev->kdrv = RTE_KDRV_NIC_UIO;
@@ -324,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) {
@@ -332,6 +331,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
                        } else { /* already registered */
                                dev2->kdrv = dev->kdrv;
                                dev2->max_vfs = dev->max_vfs;
+                               pci_name_set(dev2);
                                memmove(dev2->mem_resource,
                                        dev->mem_resource,
                                        sizeof(dev->mem_resource));
@@ -368,7 +368,7 @@ rte_pci_scan(void)
        };
 
        /* for debug purposes, PCI can be disabled */
-       if (internal_config.no_pci)
+       if (!rte_eal_has_pci())
                return 0;
 
        fd = open("/dev/pci", O_RDONLY);
@@ -394,7 +394,7 @@ rte_pci_scan(void)
 
        close(fd);
 
-       RTE_LOG(ERR, EAL, "PCI scan found %u devices\n", dev_count);
+       RTE_LOG(DEBUG, EAL, "PCI scan found %u devices\n", dev_count);
        return 0;
 
 error:
@@ -403,6 +403,16 @@ error:
        return -1;
 }
 
+/*
+ * Get iommu class of PCI devices on the bus.
+ */
+enum rte_iova_mode
+rte_pci_get_iommu_class(void)
+{
+       /* Supports only RTE_KDRV_NIC_UIO */
+       return RTE_IOVA_PA;
+}
+
 int
 pci_update_device(const struct rte_pci_addr *addr)
 {