From c57f6e5c604a3101fe1a08ef01dfff5fbf1dfbea Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Tue, 24 Nov 2020 16:14:15 +0100 Subject: [PATCH] eal: fix plugin loading Commit 49b536fc3060 ("eal: load only shared libs from driver plugin directories") introduced a check that any shared library must ends with .so, but it can't work, at least, on Fedora/CentOS/RHEL since .so symlinks are not installed when you install dpdk package, but only when you install dpdk-devel package. This commit adds also a check for .so.ABI_VERSION to check for shared lib. See Fedora Packaging Guidelines for more information: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages Fixes: 49b536fc3060 ("eal: load only shared libs from driver plugin directories") Cc: stable@dpdk.org Signed-off-by: Timothy Redaelli Acked-by: Bruce Richardson Acked-by: David Marchand Acked-by: Maxime Coquelin Tested-by: Ferruh Yigit Tested-by: Ali Alnubani --- lib/librte_eal/common/eal_common_options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index ac3884a371..424e8bcf87 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -402,8 +402,10 @@ eal_plugindir_init(const char *path) struct stat sb; int nlen = strnlen(dent->d_name, sizeof(dent->d_name)); - /* check if name ends in .so */ - if (strcmp(&dent->d_name[nlen - 3], ".so") != 0) + /* check if name ends in .so or .so.ABI_VERSION */ + if (strcmp(&dent->d_name[nlen - 3], ".so") != 0 && + strcmp(&dent->d_name[nlen - 4 - strlen(ABI_VERSION)], + ".so."ABI_VERSION) != 0) continue; snprintf(sopath, sizeof(sopath), "%s/%s", path, dent->d_name);