From d9dd34bc8a70e80fdac3f4da45ad987e614a1154 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 25 Oct 2016 14:50:40 -0700 Subject: [PATCH] pci: probe only devices without any driver If the user asks to probe multiple times, the probe callback should only be called on devices that don't have a driver already loaded. This is useful if a driver is registered after the execution of a program has started and the list of devices needs to be re-scanned. Signed-off-by: Ben Walker --- lib/librte_eal/common/eal_common_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 638cd86e48..971ad20f94 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -289,6 +289,10 @@ pci_probe_all_drivers(struct rte_pci_device *dev) 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) -- 2.20.1