[dpdk-dev] [PATCH 2/2] eal: DPDK init doesn't fail even if device probe fails.

Nitin Katiyar nitin.katiyar at ericsson.com
Tue Aug 27 21:30:17 CEST 2019


rte_bus_probe() doesn't return error. As a result rte_eal_init()
doesn't catch this error and thus making dpdk initialization
successful despite probe failing for devices.

This patch returns error if probe fails for any of device.

Signed-off-by: Nitin Katiyar <nitin.katiyar at ericsson.com>
---
 lib/librte_eal/common/eal_common_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
index baa5b53..1721179 100644
--- a/lib/librte_eal/common/eal_common_bus.c
+++ b/lib/librte_eal/common/eal_common_bus.c
@@ -70,16 +70,20 @@
 		}
 
 		ret = bus->probe();
-		if (ret)
+		if (ret) {
 			RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
 				bus->name);
+			return ret;
+		}
 	}
 
 	if (vbus) {
 		ret = vbus->probe();
-		if (ret)
+		if (ret) {
 			RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
 				vbus->name);
+			return ret;
+		}
 	}
 
 	return 0;
-- 
1.9.1



More information about the dev mailing list