DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Panu Matilainen <pmatilai@redhat.com>
Cc: dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [dpdk-dev] [PATCHv2 4/4] pmdinfo.py: Add tool to query binaries for hw and other support information
Date: Fri, 20 May 2016 10:20:51 -0400	[thread overview]
Message-ID: <20160520142051.GB17882@hmsreliant.think-freely.org> (raw)
In-Reply-To: <ab41bf8b-7841-e747-1504-b78a346b2f44@redhat.com>

On Fri, May 20, 2016 at 08:22:34AM +0300, Panu Matilainen wrote:
> On 05/19/2016 03:00 PM, Neil Horman wrote:
> > On Thu, May 19, 2016 at 12:02:27PM +0300, Panu Matilainen wrote:
> > > On 05/19/2016 12:08 AM, Neil Horman wrote:
> > > > This tool searches for the primer sting PMD_DRIVER_INFO= in any ELF binary,
> > > > and, if found parses the remainder of the string as a json encoded string,
> > > > outputting the results in either a human readable or raw, script parseable
> > > > format
> > > > 
> > > > Note that, in the case of dynamically linked applications, pmdinfo.py will scan
> > > > for implicitly linked PMDs by searching the specified binaries .dynamic section
> > > > for DT_NEEDED entries that contain the substring librte_pmd.  The DT_RUNPATH,
> > > > LD_LIBRARY_PATH, /usr/lib and /lib are searched for these libraries, in that
> > > > order
> > > 
> > > Scanning /usr/lib and /lib does little good on systems where /usr/lib64 and
> > > /lib64 are the standard path, such as x86_64 Fedora / RHEL and derivates.
> > > 
> > Ah, sorry, forgot the 64 bit variants, I can add those in.
> > 
> > > With the path changed (or LD_LIBRARY_PATH set manually), I can confirm it
> > > works for a shared binary which is --whole-archive linked to all of DPDK
> > > such as ovs-vswitchd currently is (because it needs to for static DPDK
> > > linkage and is not aware of plugin autoloading).
> > > 
> > Right, thats why it works, because DPDK always requires --whole-archive for
> > static linking, and likely always will (see commit
> > 20afd76a504155e947c770783ef5023e87136ad8)
> > 
> > > It doesn't help testpmd though because its not linked with --whole-archive
> > > in the shared case, so its not working for the main DPDK executable...
> > > 
> > This sentence doesn't make sense --whole-archive is only applicable in the
> > static binary case, and only when linking archive files.
> 
> Okay sorry I was indeed mixing up things here.
> 
> 1) Testpmd doesn't get linked to those pmds at all, because of this in
> mk/rte.app.mk:
> 
> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
> # plugins (link only if static libraries)
> ...
> endif
> 
> 2) I'm could swear I've seen --whole-archive it make a difference on newer
> toolchains with the linker script, but I can't reproduce that now no matter
> what. Must've been hallucinating ;)
> 
I think so.  DSO's don't really mesh with the concept of --whole-archive because
they automatically keep their entire contents (since you won't know what symbols
a given application will use at run time)

> > 
> > > In any case, using --whole-archive is a sledgehammer solution at best, and
> > > against the spirit of shared libs and plugins in particular.
> > > 
> > It may be a sledgehammer solution, but its the one dpdk uses, and will likely
> > use in perpituity.
> > 
> > > I think the shared linkage case can be solved by exporting the PMD path from
> > > librte_eal (either through an elf section or c-level symbol) and teach the
> > > script to detect the case of an executable dynamically linked to librte_eal,
> > > fish the path from there and then process everything in that path.
> > > 
> > I really disagree with this, because its a half-measure at best.  Yes, if its
> > set, you will definately get all the shared objects in that directory loaded,
> > but that is in no way a guarantee that those are the only libraries that get
> > loaded (the application may load its own independently).
> 
> That is in no way different from statically linked apps loading additional
> drivers with the EAL -d switch.
> 


Sooo....we agree?

> > So you're left in this
> > situation in which you get maybe some of the hardware support an application
> > offers.  Its also transient.  That is to say, if you configure a plugin
> > directory and search it when you scan an application, its contents may change
> > post scan, leading to erroneous results.
> 
> Yes, changing system state such as installing or removing packages between
> scanning and running can "do stuff" such as change results. People are quite
> aware of this because that's how a huge number of things in the system
> works, you install plugins for multimedia formats you need, maybe remove
> others you dont to clean up system etc. I fail to see how that is a problem
> when it's the expected behavior with plugins.
> 
> > The way I see it, we have 3 cases that we need to handle:
> > 
> > 1) Statically linked application - in this case, all pmds that are statically
> > linked in to the application will be reported, so we're good here
> > 
> > 2) Dynamically loaded via DT_NEEDED entries - This is effectively the same as a
> > static linking case, in that we have a list of libraries that must be resolved
> > at run time, so we are safe to search for and scan the DSO's that the
> > application ennumerates
> > 
> > 3) Dynamically loaded via dlopen - In this case, we don't actually know until
> > runtime what DSO's are going to get loaded, even if RTE_EAL_PMD_PATH is set,
> > because the contents of that path can change at arbitrary times.  In this case,
> > its correct to indicate that the application itself _doesn't_ actually support
> > the hardware of the PMD's in that path, because until the application is
> > executed, it has none of the support embodied in any DSO that it loads via
> > dlopen.  The hardware support travels with the DSO itself, and so its correct to
> > only display hardware support when the PMD shared library itself is scanned.
> > 
> > Handling case 3 the way I'm proposing is exactly the way the OS does it (that is
> > to say, it only details hardware support for the module being queried, and you
> > have to specify the module name to get that).  I don't see there being any
> > problem with that.
> 
> Ability to query individual DSOs is a building block for other things like
> automation (you dont expect normal users to go manually loading hw support
> modules for the OS either), but its not an end-user solution.
> 
> Thomas said in http://dpdk.org/ml/archives/dev/2016-May/038324.html:
> 
> "This tool should not behave differently depending of how DPDK was compiled
> (static or shared)."
> 
> Its entirely possible to handle all the three above cases virtually
> identically (point the tool to the app executable), so I have a hard time
> understanding the level of resistance to handling the plugin case.
> 
Because you're applying some meaning to the idea that Thomas listed, and
it simply doesn't work like that.  Look, try it by using this statement:

"pmdinfo.py lists hardware support that an application has at run time"

Using that statement:

1) Any pmd that is statically linked into the application is guaranteed to be
present at run time, and so is reported

2) Any pmd that is dynamically linked at link time is guarateed to be available
at run time (because the DT_NEEDED entry implies that said pmd has to be loaded
for the application to run), and so the hw support is reported

3) Any pmd that is dynamically loaded via the the RTE_EAL_PMD_PATH or the -d
command line option is _not_ guaranteed to be there at run time, and so is not
reported.

The only reason that your argument about automatically scanning stuff in the
plugin directory makes sense is because you're enforcing the assumption that the
contents of that directory remain unchanged between scan time and run time.  If
thats true great, if not, we get incorrect resulsts.  And we don't address the
-d option at all.

If you want to make the consistency argument, I assert that what we have now is
in fact the most consistent solution.

Please see my elarier email for a compromise solution I'm willing to implement

Neil

  parent reply	other threads:[~2016-05-20 14:21 UTC|newest]

Thread overview: 166+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 20:41 [dpdk-dev] [PATCH 0/4] Implement pmd hardware support exports Neil Horman
2016-05-16 20:41 ` [dpdk-dev] [PATCH 1/4] pmdinfo: Add buildtools and pmdinfo utility Neil Horman
2016-05-16 20:41 ` [dpdk-dev] [PATCH 2/4] drivers: Update driver registration macro usage Neil Horman
2016-05-16 20:41 ` [dpdk-dev] [PATCH 3/4] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-16 20:41 ` [dpdk-dev] [PATCH 4/4] pmd_hw_support.py: Add tool to query binaries for hw support information Neil Horman
2016-05-18 11:48   ` Panu Matilainen
2016-05-18 12:03     ` Neil Horman
2016-05-18 12:48       ` Panu Matilainen
2016-05-18 13:48         ` Neil Horman
2016-05-19  6:08           ` Panu Matilainen
2016-05-19 13:26             ` Neil Horman
2016-05-20  7:30               ` Panu Matilainen
2016-05-20 14:06                 ` Neil Horman
2016-05-23 11:56                   ` Panu Matilainen
2016-05-23 13:55                     ` Neil Horman
2016-05-24  6:15                       ` Panu Matilainen
2016-05-24 14:55                         ` Neil Horman
2016-05-18 12:38     ` Thomas Monjalon
2016-05-18 13:09       ` Panu Matilainen
2016-05-18 13:26         ` Thomas Monjalon
2016-05-18 13:54           ` Neil Horman
2016-05-18 21:08 ` [dpdk-dev] [PATCHv2 0/4] Implement pmd hardware support exports Neil Horman
2016-05-18 21:08   ` [dpdk-dev] [PATCHv2 1/4] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-05-19  7:51     ` Panu Matilainen
2016-05-19 12:00       ` Neil Horman
2016-05-18 21:08   ` [dpdk-dev] [PATCHv2 2/4] drivers: Update driver registration macro usage Neil Horman
2016-05-19  7:58     ` Panu Matilainen
2016-05-19 10:45       ` Neil Horman
2016-05-19 10:51     ` [dpdk-dev] [dpdk-dev, PATCHv2, " Jan Viktorin
     [not found]     ` <20160519124650.060aa09a@pcviktorin.fit.vutbr.cz>
2016-05-19 11:40       ` Neil Horman
2016-05-18 21:08   ` [dpdk-dev] [PATCHv2 3/4] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-18 21:08   ` [dpdk-dev] [PATCHv2 4/4] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-05-19  9:02     ` Panu Matilainen
2016-05-19 12:00       ` Neil Horman
2016-05-20  5:22         ` Panu Matilainen
2016-05-20  8:55           ` Thomas Monjalon
2016-05-20  9:12             ` Panu Matilainen
2016-05-20 14:22             ` Neil Horman
2016-05-20 14:20           ` Neil Horman [this message]
2016-05-20 17:24 ` [dpdk-dev] [PATCHv3 0/5] Implement pmd hardware support exports Neil Horman
2016-05-20 17:24   ` [dpdk-dev] [PATCHv3 1/5] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-05-20 17:24   ` [dpdk-dev] [PATCHv3 2/5] drivers: Update driver registration macro usage Neil Horman
2016-05-24  6:57     ` Panu Matilainen
2016-05-24 13:21       ` Neil Horman
2016-05-20 17:24   ` [dpdk-dev] [PATCHv3 3/5] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-05-20 17:24   ` [dpdk-dev] [PATCHv3 4/5] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-20 17:24   ` [dpdk-dev] [PATCHv3 5/5] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-05-24  7:41     ` Panu Matilainen
2016-05-24 15:17       ` Neil Horman
2016-05-24  8:34     ` Panu Matilainen
2016-05-24 19:41 ` [dpdk-dev] [PATCHv4 0/5] Implement pmd hardware support exports Neil Horman
2016-05-24 19:41   ` [dpdk-dev] [PATCHv4 1/5] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-05-25 13:21     ` Thomas Monjalon
2016-05-25 17:22       ` Neil Horman
2016-05-25 17:39         ` Thomas Monjalon
2016-05-25 19:13           ` Neil Horman
2016-05-25 19:39             ` Thomas Monjalon
2016-05-25 19:57               ` Neil Horman
2016-05-24 19:41   ` [dpdk-dev] [PATCHv4 2/5] drivers: Update driver registration macro usage Neil Horman
2016-05-25 16:20     ` Thomas Monjalon
2016-05-25 17:35       ` Neil Horman
2016-05-24 19:41   ` [dpdk-dev] [PATCHv4 3/5] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-05-24 19:41   ` [dpdk-dev] [PATCHv4 4/5] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-25 17:08     ` Thomas Monjalon
2016-05-25 17:40       ` Neil Horman
2016-05-25 18:56         ` Thomas Monjalon
2016-05-25 19:43           ` Neil Horman
2016-05-25 20:04             ` Thomas Monjalon
2016-05-25 20:16               ` Neil Horman
2016-05-24 19:41   ` [dpdk-dev] [PATCHv4 5/5] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-05-25 17:22     ` Thomas Monjalon
2016-05-25 17:47       ` Neil Horman
2016-05-25 18:58         ` Thomas Monjalon
2016-05-27  9:16           ` Panu Matilainen
2016-05-27 11:35             ` Neil Horman
2016-05-27 12:46               ` Panu Matilainen
2016-05-25  8:32   ` [dpdk-dev] [PATCHv4 0/5] Implement pmd hardware support exports Panu Matilainen
2016-05-25 11:27     ` Neil Horman
2016-05-26 17:17 ` [dpdk-dev] [PATCHv5 0/6] " Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 1/6] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 2/6] drivers: Update driver registration macro usage Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 3/6] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 4/6] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 5/6] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-05-27 14:38     ` Mcnamara, John
2016-05-27 19:56       ` Neil Horman
2016-05-26 17:17   ` [dpdk-dev] [PATCHv5 6/6] remove rte.hostapp.mk Neil Horman
2016-05-31 13:57 ` [dpdk-dev] [PATCHv6 0/7] Implement pmd hardware support exports Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 1/7] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-06-07  9:57     ` Thomas Monjalon
2016-06-07 12:04       ` Neil Horman
2016-06-07 12:53         ` Thomas Monjalon
2016-06-07 13:03           ` Neil Horman
2016-06-07 13:24             ` Thomas Monjalon
2016-06-07 13:49               ` Neil Horman
2016-06-07 14:09                 ` Thomas Monjalon
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 2/7] drivers: Update driver registration macro usage Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 3/7] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 4/7] Makefile: Do post processing on objects that register a driver Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 5/7] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 6/7] remove rte.hostapp.mk Neil Horman
2016-05-31 13:57   ` [dpdk-dev] [PATCHv6 7/7] doc: Add prog_guide section documenting pmdinfo script Neil Horman
2016-06-08 17:14     ` Mcnamara, John
2016-06-09 17:31       ` Neil Horman
2016-06-05  0:20   ` [dpdk-dev] [PATCHv6 0/7] Implement pmd hardware support exports Neil Horman
2016-06-07  9:34   ` Thomas Monjalon
2016-06-07 12:08     ` Neil Horman
2016-06-07 12:27       ` Thomas Monjalon
2016-06-09 17:46 ` [dpdk-dev] [PATCHv7 0/6] " Neil Horman
2016-06-09 17:46   ` [dpdk-dev] [PATCHv7 1/6] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-06-16 12:29     ` Panu Matilainen
2016-06-16 13:33       ` Neil Horman
2016-06-16 14:06         ` Panu Matilainen
2016-06-16 14:41           ` Neil Horman
2016-06-09 17:46   ` [dpdk-dev] [PATCHv7 2/6] drivers: Update driver registration macro usage Neil Horman
2016-06-09 17:46   ` [dpdk-dev] [PATCHv7 3/6] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-06-09 17:46   ` [dpdk-dev] [PATCHv7 4/6] Makefile: Do post processing on objects that register a driver Neil Horman
2016-06-09 17:47   ` [dpdk-dev] [PATCHv7 5/6] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-06-16 12:32     ` Panu Matilainen
2016-06-09 17:47   ` [dpdk-dev] [PATCHv7 6/6] doc: Add prog_guide section documenting pmdinfo script Neil Horman
2016-06-09 19:55     ` Mcnamara, John
2016-06-17 18:46   ` [dpdk-dev] [PATCHv8 0/6] Implement pmd hardware support exports Neil Horman
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 1/6] pmdinfogen: Add buildtools and pmdinfogen utility Neil Horman
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 2/6] drivers: Update driver registration macro usage Neil Horman
2016-07-07 11:00       ` De Lara Guarch, Pablo
2016-07-07 11:39         ` Neil Horman
2016-07-07 15:37         ` [dpdk-dev] [PATCH] crypto: normalize cryptodev pmd names with macros Neil Horman
2016-07-08  9:09           ` De Lara Guarch, Pablo
2016-07-08 12:17             ` Neil Horman
2016-07-08 12:40               ` Thomas Monjalon
2016-07-08 13:42                 ` Neil Horman
2016-07-08 19:03                   ` Mcnamara, John
2016-07-09 13:34                     ` Neil Horman
2016-07-09 16:04                       ` Mcnamara, John
2016-07-08 14:00               ` De Lara Guarch, Pablo
2016-07-08 14:14                 ` Neil Horman
2016-07-08 10:03           ` Thomas Monjalon
2016-07-08 16:34           ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2016-07-08 16:46             ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2016-07-08 17:14               ` Thomas Monjalon
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 3/6] eal: Add an export symbol to expose the autoload path to external tools Neil Horman
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 4/6] Makefile: Do post processing on objects that register a driver Neil Horman
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 5/6] pmdinfo.py: Add tool to query binaries for hw and other support information Neil Horman
2016-06-29 15:12       ` Remy Horton
2016-06-29 16:18         ` Neil Horman
2016-06-30  7:45           ` Remy Horton
2016-06-17 18:46     ` [dpdk-dev] [PATCHv8 6/6] doc: Add prog_guide section documenting pmdinfo script Neil Horman
2016-06-29  9:18     ` [dpdk-dev] [PATCHv8 0/6] Implement pmd hardware support exports Remy Horton
2016-06-29 11:31       ` Neil Horman
2016-06-30  7:45     ` Remy Horton
2016-07-06 21:21       ` Thomas Monjalon
2016-07-04  1:13     ` [dpdk-dev] [PATCH v9 0/7] export PMD infos Thomas Monjalon
2016-07-04  1:13       ` [dpdk-dev] [PATCH v9 1/7] drivers: export infos as string symbols Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 2/7] mk: remove recipe for tool library Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 3/7] mk: refresh recipe for any host application Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 4/7] pmdinfogen: parse driver to generate code to export Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 5/7] mk: link infos generated by pmdinfogen Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 6/7] eal: export default plugin path to external tools Thomas Monjalon
2016-07-04  1:14       ` [dpdk-dev] [PATCH v9 7/7] tools: query binaries for support information Thomas Monjalon
2016-07-04 12:34       ` [dpdk-dev] [PATCH v9 0/7] export PMD infos Neil Horman
2016-07-04 13:10         ` Thomas Monjalon
2016-07-04 16:41           ` Neil Horman
2016-07-04 20:10             ` Thomas Monjalon
2016-07-05 20:08               ` Neil Horman
2016-07-06 15:33                 ` Thomas Monjalon
2016-07-04 15:22       ` Bruce Richardson

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=20160520142051.GB17882@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=pmatilai@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.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
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).