eal: allow user to override default mempool driver
[dpdk.git] / lib / librte_eal / common / eal_common_pci.c
index cdd197a..0f0e4b9 100644 (file)
@@ -150,16 +150,8 @@ pci_unmap_resource(void *requested_addr, size_t size)
 
 /*
  * Match the PCI Driver and Device using the ID Table
- *
- * @param pci_drv
- *     PCI driver from which ID table would be extracted
- * @param pci_dev
- *     PCI device to match against the driver
- * @return
- *     1 for successful match
- *     0 for unsuccessful match
  */
-static int
+int
 rte_pci_match(const struct rte_pci_driver *pci_drv,
              const struct rte_pci_device *pci_dev)
 {
@@ -219,13 +211,18 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
 
        /* no initialization when blacklisted, return without error */
        if (dev->device.devargs != NULL &&
-               dev->device.devargs->type ==
-                       RTE_DEVTYPE_BLACKLISTED) {
+               dev->device.devargs->policy ==
+                       RTE_DEV_BLACKLISTED) {
                RTE_LOG(INFO, EAL, "  Device is blacklisted, not"
                        " initializing\n");
                return 1;
        }
 
+       if (dev->device.numa_node < 0) {
+               RTE_LOG(WARNING, EAL, "  Invalid NUMA socket, default to 0\n");
+               dev->device.numa_node = 0;
+       }
+
        RTE_LOG(INFO, EAL, "  probe driver: %x:%x %s\n", dev->id.vendor_id,
                dev->id.device_id, dr->driver.name);
 
@@ -424,7 +421,7 @@ rte_pci_probe(void)
                if (probe_all)
                        ret = pci_probe_all_drivers(dev);
                else if (devargs != NULL &&
-                       devargs->type == RTE_DEVTYPE_WHITELISTED)
+                       devargs->policy == RTE_DEV_WHITELISTED)
                        ret = pci_probe_all_drivers(dev);
                if (ret < 0) {
                        RTE_LOG(ERR, EAL, "Requested device " PCI_PRI_FMT
@@ -541,7 +538,7 @@ pci_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
 }
 
 static int
-pci_plug(struct rte_device *dev, const char *devargs __rte_unused)
+pci_plug(struct rte_device *dev)
 {
        return pci_probe_all_drivers(RTE_DEV_TO_PCI(dev));
 }
@@ -567,6 +564,7 @@ struct rte_pci_bus rte_pci_bus = {
                .plug = pci_plug,
                .unplug = pci_unplug,
                .parse = pci_parse,
+               .get_iommu_class = rte_pci_get_iommu_class,
        },
        .device_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.device_list),
        .driver_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.driver_list),