patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Timothy Redaelli <tredaelli@redhat.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: bruce.richardson@intel.com, dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 1/2] eal: fix shared lib mode detection
Date: Tue, 24 Nov 2020 16:14:14 +0100	[thread overview]
Message-ID: <1bbaefeb069a75f57a2f49b4217efa994bed5d4b.1606229937.git.tredaelli@redhat.com> (raw)
Message-ID: <20201124151414.yRZzoVtyQMRubR6_zbBYkC3O5htZZJgHLjXhgsIQneQ@z> (raw)
In-Reply-To: <cover.1606229937.git.tredaelli@redhat.com>

Commit 06c7871dde01 ("eal: restrict default plugin path to shared lib mode")
introduced a check that enabled shared lib mode when librte_eal.so can
be loaded, 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 uses librte_eal.so.ABI_VERSION to check for shared lib,
since it exists on any linux distributions.

See Fedora Packaging Guidelines for more informations:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages

Fixes: 06c7871dde01 ("eal: restrict default plugin path to shared lib mode")
Cc: bruce.richardson@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 lib/librte_eal/common/eal_common_options.c | 3 ++-
 lib/librte_eal/common/meson.build          | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index fc6f0cea93..e6f77ad217 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -503,7 +503,8 @@ eal_plugins_init(void)
 	 * (Using dlopen with NOLOAD flag on EAL, will return NULL if the EAL
 	 * shared library is not already loaded i.e. it's statically linked.)
 	 */
-	if (dlopen("librte_eal.so", RTLD_LAZY | RTLD_NOLOAD) != NULL &&
+	if (dlopen("librte_eal.so."ABI_VERSION, RTLD_LAZY | RTLD_NOLOAD)
+			!= NULL &&
 			*default_solib_dir != '\0' &&
 			stat(default_solib_dir, &sb) == 0 &&
 			S_ISDIR(sb.st_mode))
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
index 9f32262450..39abf7a0a4 100644
--- a/lib/librte_eal/common/meson.build
+++ b/lib/librte_eal/common/meson.build
@@ -3,6 +3,8 @@
 
 includes += include_directories('.')
 
+cflags += [ '-DABI_VERSION="@0@"'.format(abi_version) ]
+
 if is_windows
 	sources += files(
 		'eal_common_bus.c',
-- 
2.28.0


  reply	other threads:[~2020-11-24 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 15:13 [dpdk-stable] [PATCH 0/2] Fix shared lib detection on Fedora/CentOS/RHEL Timothy Redaelli
2020-11-24 15:13 ` Timothy Redaelli [this message]
2020-11-24 15:14   ` [dpdk-stable] [PATCH 1/2] eal: fix shared lib mode detection Timothy Redaelli
2020-11-24 15:22   ` Bruce Richardson
2020-11-25  9:10   ` David Marchand
2020-11-24 15:14 ` [dpdk-stable] [PATCH 0/2] Fix shared lib detection on Fedora/CentOS/RHEL Timothy Redaelli
2020-11-24 15:14 ` [dpdk-stable] [PATCH 2/2] eal: fix loading of shared libs from driver plugin directories Timothy Redaelli
2020-11-24 15:22   ` Bruce Richardson
2020-11-25 10:01   ` David Marchand
2020-11-25 11:05     ` Ferruh Yigit
2020-11-25 10:57 ` [dpdk-stable] [dpdk-dev] [PATCH 0/2] Fix shared lib detection on Fedora/CentOS/RHEL Maxime Coquelin
2020-11-25 15:56 ` [dpdk-stable] " Ali Alnubani
2020-11-25 15:59 ` [dpdk-stable] [dpdk-dev] " Ali Alnubani
2020-11-25 22:54 ` [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bbaefeb069a75f57a2f49b4217efa994bed5d4b.1606229937.git.tredaelli@redhat.com \
    --to=tredaelli@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).