git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vfio: fix maximum number of interrupt for MSI-X
[dpdk.git]
/
lib
/
librte_eal
/
common
/
eal_common_pci.c
diff --git
a/lib/librte_eal/common/eal_common_pci.c
b/lib/librte_eal/common/eal_common_pci.c
index
609c424
..
72547bd
100644
(file)
--- a/
lib/librte_eal/common/eal_common_pci.c
+++ b/
lib/librte_eal/common/eal_common_pci.c
@@
-203,18
+203,20
@@
rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
ret = rte_eal_pci_map_device(dev);
if (ret != 0)
return ret;
ret = rte_eal_pci_map_device(dev);
if (ret != 0)
return ret;
- } else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND &&
- rte_eal_process_type() == RTE_PROC_PRIMARY) {
- /* unbind current driver */
- if (pci_unbind_kernel_driver(dev) < 0)
- return -1;
}
/* reference driver structure */
dev->driver = dr;
/* call the driver probe() function */
}
/* reference driver structure */
dev->driver = dr;
/* call the driver probe() function */
- return dr->probe(dr, dev);
+ ret = dr->probe(dr, dev);
+ if (ret) {
+ dev->driver = NULL;
+ if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)
+ rte_eal_pci_unmap_device(dev);
+ }
+
+ return ret;
}
/* return positive value if driver doesn't support this device */
return 1;
}
/* return positive value if driver doesn't support this device */
return 1;
@@
-289,6
+291,10
@@
pci_probe_all_drivers(struct rte_pci_device *dev)
if (dev == NULL)
return -1;
if (dev == NULL)
return -1;
+ /* Check if a driver is already loaded */
+ if (dev->driver != NULL)
+ return 0;
+
TAILQ_FOREACH(dr, &pci_driver_list, next) {
rc = rte_eal_pci_probe_one_driver(dr, dev);
if (rc < 0)
TAILQ_FOREACH(dr, &pci_driver_list, next) {
rc = rte_eal_pci_probe_one_driver(dr, dev);
if (rc < 0)
@@
-353,7
+359,7
@@
rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
continue;
ret = pci_probe_all_drivers(dev);
continue;
ret = pci_probe_all_drivers(dev);
- if (ret
< 0
)
+ if (ret)
goto err_return;
return 0;
}
goto err_return;
return 0;
}
@@
-387,6
+393,7
@@
rte_eal_pci_detach(const struct rte_pci_addr *addr)
goto err_return;
TAILQ_REMOVE(&pci_device_list, dev, next);
goto err_return;
TAILQ_REMOVE(&pci_device_list, dev, next);
+ free(dev);
return 0;
}
return -1;
return 0;
}
return -1;