From acabcb6c3fe092bd1037d159ca00124c7100f19e Mon Sep 17 00:00:00 2001 From: Damien Millescamps Date: Mon, 30 Jul 2012 11:47:27 +0200 Subject: [PATCH] pci: fix uio driver dependency 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 Signed-off-by: Damien Millescamps Acked-by: Adrien Mazarguil --- lib/librte_eal/linuxapp/eal/eal_pci.c | 12 +++++++----- 1 file 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 7370335b00..0a60bb3cff 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -670,15 +670,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++) { @@ -699,6 +696,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)) { -- 2.20.1