DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: don't use default library path for static binaries
Date: Mon, 29 Jun 2020 08:41:46 -0700	[thread overview]
Message-ID: <20200629084146.6951685c@hermes.lan> (raw)
In-Reply-To: <20200629091910.GB572@bricha3-MOBL.ger.corp.intel.com>

On Mon, 29 Jun 2020 10:19:10 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Mon, Jun 29, 2020 at 10:11:58AM +0100, Bruce Richardson wrote:
> > On Fri, Jun 26, 2020 at 10:05:42AM -0700, Stephen Hemminger wrote:  
> > > On Fri, 26 Jun 2020 15:59:57 +0100
> > > Bruce Richardson <bruce.richardson@intel.com> wrote:
> > >   
> > > > When using statically linked DPDK binaries, the EAL checks the default PMD
> > > > path and tries to load any drivers there, despite the fact that all drivers
> > > > are normally linked into the binary.  This behaviour can cause issues if
> > > > the PMD path and lib dir is configured to a non-standard location which is
> > > > not in the ld.so.conf paths, e.g. a build with prefix set to a home
> > > > directory location. In a case such as this, EAL will try and
> > > > (unnecessarily) load the .so driver files but that load will fail as their
> > > > dependent libraries, such as ethdev, for example, will not be found.
> > > > 
> > > > Because of this, it is better if statically linked DPDK apps do not load
> > > > drivers from the standard paths automatically. The user can always have
> > > > this behaviour by explicitly specifying the path using -d flag, if so
> > > > desired.
> > > > 
> > > > Not loading the libraries automatically can also prevent potential issues
> > > > with a user building and running a statically-linked DPDK binary based off
> > > > a private copy of DPDK, while there exists on the same machine a
> > > > system-wide installation of DPDK in the default locations. Without this
> > > > change, the system-installed drivers will be loaded to the binary alongside
> > > > the statically-linked drivers, which is not what the user would have
> > > > intended.
> > > > 
> > > > To detect whether we are in a statically or dynamically linked binary, we
> > > > can have EAL try to get a dlopen handle to its own shared library, by
> > > > calling dlopen with the RTLD_NOLOAD flag. This will return NULL if there is
> > > > no such shared lib loaded i.e. the code is executing from a static library,
> > > > or a handle to the lib if it is loaded.
> > > > 
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>  
> > > 
> > > But what if the majority of the DPDK is statically linked but the
> > > application wants also load a dynamically linked driver?
> > >   
> > They use the -d flag as now. The only change here is that we don't
> > *automatically* (and silently) attempt to load all drivers from a system
> > location when you have a static binary.  
> 
> I'd also make a couple of additional points:
> 1. If you have a static app and you have extra drivers in your EAL_PMD_PATH
> directory you have no way of preventing the loading of them.
> 
> 2. Since all DPDK apps try to load all files in that directory, all one has
> to do is put a non-loadable file into the DPDK PMD directory and suddenly
> all DPDK apps on the system will fail to run.  [Patchset
> http://patches.dpdk.org/project/dpdk/list/?series=10553 will also help
> here]
> 
> 3. Since this is a behaviour change, perhaps it needs to be deferred to
> 20.11? Ideally I think we should fix this now, because I think the current
> behaviour doesn't make sense and causes more problems than it solves, but
> if it needs to be deferred, so be it.


Thanks, just trying to poke the corners of this change.
Please make sure the documentation and web site match the behavior.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

  reply	other threads:[~2020-06-29 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 14:59 Bruce Richardson
2020-06-26 17:05 ` Stephen Hemminger
2020-06-29  9:11   ` Bruce Richardson
2020-06-29  9:19     ` Bruce Richardson
2020-06-29 15:41       ` Stephen Hemminger [this message]
2020-06-29 16:15         ` Bruce Richardson
2020-07-05 18:01           ` Thomas Monjalon
2020-06-29 14:53 ` Burakov, Anatoly
2020-06-30 15:39 Pai G, Sunil

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=20200629084146.6951685c@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@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).