pci: introduce helpers for device name parsing/update
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci.c
index f9c3efd..62da4d4 100644 (file)
@@ -417,6 +417,19 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,
        return 0;
 }
 
+int
+pci_update_device(const struct rte_pci_addr *addr)
+{
+       char filename[PATH_MAX];
+
+       snprintf(filename, sizeof(filename), "%s/" PCI_PRI_FMT,
+                pci_get_sysfs_path(), addr->domain, addr->bus, addr->devid,
+                addr->function);
+
+       return pci_scan_one(filename, addr->domain, addr->bus, addr->devid,
+                               addr->function);
+}
+
 /*
  * split up a pci address into its constituent parts.
  */
@@ -743,9 +756,6 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p)
 int
 rte_eal_pci_init(void)
 {
-       TAILQ_INIT(&pci_driver_list);
-       TAILQ_INIT(&pci_device_list);
-
        /* for debug purposes, PCI can be disabled */
        if (internal_config.no_pci)
                return 0;
@@ -754,21 +764,6 @@ rte_eal_pci_init(void)
                RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
                return -1;
        }
-#ifdef VFIO_PRESENT
-       pci_vfio_enable();
-
-       if (pci_vfio_is_enabled()) {
-
-               /* if we are primary process, create a thread to communicate with
-                * secondary processes. the thread will use a socket to wait for
-                * requests from secondary process to send open file descriptors,
-                * because VFIO does not allow multiple open descriptors on a group or
-                * VFIO container.
-                */
-               if (internal_config.process_type == RTE_PROC_PRIMARY &&
-                               pci_vfio_mp_sync_setup() < 0)
-                       return -1;
-       }
-#endif
+
        return 0;
 }