DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Timothy Redaelli <tredaelli@redhat.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] eal: fix shared lib mode detection
Date: Tue, 24 Nov 2020 15:22:17 +0000
Message-ID: <20201124152217.GA1771@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <1bbaefeb069a75f57a2f49b4217efa994bed5d4b.1606229937.git.tredaelli@redhat.com>

On Tue, Nov 24, 2020 at 04:14:14PM +0100, Timothy Redaelli wrote:
> 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 &&

Since we are not so strict on the 80-char lines, I think I'd keep the
!= NULL on the original line to improve readability.

>  			*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',
> -- 

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 15:14 [dpdk-dev] [PATCH 0/2] Fix shared lib detection on Fedora/CentOS/RHEL Timothy Redaelli
2020-11-24 15:14 ` [dpdk-dev] [PATCH 1/2] eal: fix shared lib mode detection Timothy Redaelli
2020-11-24 15:22   ` Bruce Richardson [this message]
2020-11-25  9:10   ` [dpdk-dev] [dpdk-stable] " David Marchand
2020-11-24 15:14 ` [dpdk-dev] [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   ` [dpdk-dev] [dpdk-stable] " David Marchand
2020-11-25 11:05     ` Ferruh Yigit
2020-11-25 10:57 ` [dpdk-dev] [PATCH 0/2] Fix shared lib detection on Fedora/CentOS/RHEL Maxime Coquelin
2020-11-25 15:59 ` Ali Alnubani
2020-11-25 22:54 ` [dpdk-dev] [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=20201124152217.GA1771@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=tredaelli@redhat.com \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git