net/mlx4: update link status upon probing with LSC
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci.c
index e2fc219..7d6f50a 100644 (file)
@@ -99,8 +99,10 @@ rte_eal_pci_map_device(struct rte_pci_device *dev)
                break;
        case RTE_KDRV_IGB_UIO:
        case RTE_KDRV_UIO_GENERIC:
-               /* map resources for devices that use uio */
-               ret = pci_uio_map_resource(dev);
+               if (rte_eal_using_phys_addrs()) {
+                       /* map resources for devices that use uio */
+                       ret = pci_uio_map_resource(dev);
+               }
                break;
        default:
                RTE_LOG(DEBUG, EAL,
@@ -119,7 +121,10 @@ rte_eal_pci_unmap_device(struct rte_pci_device *dev)
        /* try unmapping the NIC resources using VFIO if it exists */
        switch (dev->kdrv) {
        case RTE_KDRV_VFIO:
-               RTE_LOG(ERR, EAL, "Hotplug doesn't support vfio yet\n");
+#ifdef VFIO_PRESENT
+               if (pci_vfio_is_enabled())
+                       pci_vfio_unmap_resource(dev);
+#endif
                break;
        case RTE_KDRV_IGB_UIO:
        case RTE_KDRV_UIO_GENERIC: