Skip to contentSkip to conversation

eal: avoid error for non-existent default PMD path

PATCH Applied Bruce Richardson 2 participants 2 messages Oct 19, 2017 – Oct 23, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: avoid error for non-existent default PMD path

If the default location for the PMD .so files does not exist, it should not be treated as a fatal error condition like an incorrect path on the command line. Therefore check that the path exists and is a directory before adding it to the list of paths to check for PMDs.

---
 lib/librte_eal/common/eal_common_options.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/librte_eal/common/eal_common_options.c +3 -2
index e40c04961..450f2664a 100644
@@ -278,12 +278,13 @@ int
 eal_plugins_init(void)
 {
 	struct shared_driver *solib = NULL;
+	struct stat sb;
 
-	if (*default_solib_dir != '\0')
+	if (*default_solib_dir != '\0' && stat(solib->name, &sb) == 0 &&
+				S_ISDIR(sb.st_mode))
 		eal_plugin_add(default_solib_dir);
 
 	TAILQ_FOREACH(solib, &solib_list, next) {
-		struct stat sb;
 
 		if (stat(solib->name, &sb) == 0 && S_ISDIR(sb.st_mode)) {
 			if (eal_plugindir_init(solib->name) == -1) {
Signature · 1 line
2.13.6
#1 lore raw

19/10/2017 10:49, Bruce Richardson:

Quoted 6 lines

If the default location for the PMD .so files does not exist, it should not be treated as a fatal error condition like an incorrect path on the command line. Therefore check that the path exists and is a directory before adding it to the list of paths to check for PMDs.

Applied, thanks