[dpdk-dev] [PATCH 21/22] igb_uio: fix driver dependency

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Mar 20 17:05:09 CET 2013


From: Damien Millescamps <damien.millescamps at 6wind.com>

Allow to run without igb_uio if probed devices don't require it.

The condition for exiting with an error is:
 - Tested driver is needed by a probed device
 AND
 - Tested driver needs igb_uio

Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
Signed-off-by: Damien Millescamps <damien.millescamps at 6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 86002bd..882fd6f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -701,15 +701,12 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 {
 	struct rte_pci_id *id_table;
 	const char *module_name = NULL;
-	int ret;
+	int uio_status = -1;
 
 	if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO)
 		module_name = IGB_UIO_NAME;
 
-	ret = pci_uio_check_module(module_name);
-	if (ret != 0)
-		rte_exit(1, "The %s module is required by the %s driver\n",
-				module_name, dr->name);
+	uio_status = pci_uio_check_module(module_name);
 
 	for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
 
@@ -730,6 +727,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 		RTE_LOG(DEBUG, EAL, "probe driver: %x:%x %s\n",
 		dev->id.vendor_id, dev->id.device_id, dr->name);
 
+		if ((!dev->blacklisted) && (uio_status != 0)) {
+			rte_exit(1, "The %s module is required by the %s driver\n",
+					module_name, dr->name);
+		}
+
 		/* Unbind PCI devices if needed */
 		if ((!dev->blacklisted) &&
 		    (module_name != NULL)) {
-- 
1.7.2.5




More information about the dev mailing list