DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xu, Rosen" <rosen.xu@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>,
	"robin.jarry@6wind.com" <robin.jarry@6wind.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>,
	Luca Boccassi <bluca@debian.org>
Subject: Re: [dpdk-dev] [PATCH v2] usertools: fix pmdinfo parsing
Date: Thu, 5 Nov 2020 11:46:00 +0000	[thread overview]
Message-ID: <BYAPR11MB2901BAB678C0C17DD5641B1689EE0@BYAPR11MB2901.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201104094033.29674-1-david.marchand@redhat.com>

Hi,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Wednesday, November 04, 2020 17:41
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>;
> robin.jarry@6wind.com; stephen@networkplumber.org;
> olivier.matz@6wind.com; Neil Horman <nhorman@tuxdriver.com>; Xu,
> Rosen <rosen.xu@intel.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; Luca Boccassi <bluca@debian.org>
> Subject: [PATCH v2] usertools: fix pmdinfo parsing
> 
> This script inspects an ELF file (binary or shared library) and its linked
> dependencies by following DT_NEEDED tags.
> So far a simple librte_pmd prefix was used as a filter.
> Now that we changed the driver library names, update this heuristic with an
> explicit list of all driver classes.
> 
> Fixes: a20b2c01a7a1 ("build: standardize component names and defines")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Robin Jarry <robin.jarry@6wind.com>
> ---
> Changelog since v1:
> - moved driver classes list as a class variable and did some cosmetic
>   change for readibility,
> - used dpdk_driver_classes variable name in the hope that someone
> changing
>   meson will catch this script too,
> - added bus, common, mempool and raw driver classes as some of them do
>   carry some pmdinfo stuff and were skipped so far but I found no
>   indication this skipping was intended,
> 
> ---
>  usertools/dpdk-pmdinfo.py | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index
> 1661982791..55a55affde 100755
> --- a/usertools/dpdk-pmdinfo.py
> +++ b/usertools/dpdk-pmdinfo.py
> @@ -430,6 +430,20 @@ def get_dt_runpath(self, dynsec):
>                  return force_unicode(tag.runpath)
>          return ""
> 
> +    dpdk_driver_classes = (
> +        'baseband',
> +        'bus',
> +        'common',
> +        'compress',
> +        'crypto',
> +        'event',
> +        'mempool',
> +        'net',
> +        'raw',
> +        'regex',
> +        'vdpa',
> +    )
> +
>      def process_dt_needed_entries(self):
>          """ Look to see if there are any DT_NEEDED entries in the binary
>              And process those if there are @@ -450,7 +464,11 @@ def
> process_dt_needed_entries(self):
>          for tag in dynsec.iter_tags():
>              # pyelftools may return byte-strings, force decode them
>              if force_unicode(tag.entry.d_tag) == 'DT_NEEDED':
> -                if 'librte_pmd' in force_unicode(tag.needed):
> +                words = force_unicode(tag.needed).split('_')
> +                if len(words) < 3:
> +                    continue
> +                prefix, drv_class = words[:2]
> +                if prefix == 'librte' and drv_class in self.dpdk_driver_classes:
>                      library = search_file(force_unicode(tag.needed),
>                                            runpath + ":" + ldlibpath +
>                                            ":/usr/lib64:/lib64:/usr/lib:/lib")
> --
> 2.23.0

Acked-by: Rosen Xu <rosen.xu@intel.com>

  parent reply	other threads:[~2020-11-05 11:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 18:39 [dpdk-dev] [PATCH] " David Marchand
2020-11-03 19:27 ` Robin Jarry
2020-11-03 20:20   ` David Marchand
2020-11-03 23:54     ` Stephen Hemminger
2020-11-04  8:04       ` Olivier Matz
2020-11-04  8:06     ` Robin Jarry
2020-11-04  9:40 ` [dpdk-dev] [PATCH v2] " David Marchand
2020-11-04 10:32   ` Bruce Richardson
2020-11-04 10:42     ` David Marchand
2020-11-05 11:46   ` Xu, Rosen [this message]
2020-11-12 13:28   ` David Marchand
2020-11-04 15:57 ` [dpdk-dev] [PATCH v3] " David Marchand
2020-11-04 16:35   ` Bruce Richardson
2020-11-04 16:48     ` David Marchand
2020-11-05 11:49       ` 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=BYAPR11MB2901BAB678C0C17DD5641B1689EE0@BYAPR11MB2901.namprd11.prod.outlook.com \
    --to=rosen.xu@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.com \
    --cc=olivier.matz@6wind.com \
    --cc=robin.jarry@6wind.com \
    --cc=stephen@networkplumber.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).