DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@xilinx.com>
To: Robin Jarry <rjarry@redhat.com>, <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Rasesh Mody <rmody@marvell.com>,
	Devendra Singh Rawat <dsinghrawat@marvell.com>,
	Ashwin Sekhar T K <asekhar@marvell.com>,
	Pavan Nikhilesh <pbhagavatula@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Subject: Re: [PATCH v3] usertools: rewrite pmdinfo
Date: Tue, 20 Sep 2022 11:10:38 +0100	[thread overview]
Message-ID: <27a4885e-1fa3-9856-ccb2-e8bb82a96797@xilinx.com> (raw)
In-Reply-To: <20220920090818.470814-1-rjarry@redhat.com>

On 9/20/2022 10:08 AM, Robin Jarry wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> 
> 
> dpdk-pmdinfo.py does not produce any parseable output. The -r/--raw flag
> merely prints multiple independent JSON lines which cannot be fed
> directly to any JSON parser. Moreover, the script complexity is rather
> high for such a simple task: extracting PMD_INFO_STRING from .rodata ELF
> sections. Rewrite it so that it can produce valid JSON.
> 
> Remove the PCI database parsing for PCI-ID to Vendor-Device names
> conversion. This should be done by external scripts (if really needed).
> 
> Here are some examples of use with jq:
> 
> Get the complete info for a given driver:
> 
>   ~$ usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | \
>     jq '.[] | select(.name == "dmadev_idxd_pci")'
>   {
>     "name": "dmadev_idxd_pci",
>     "params": "max_queues=0",
>     "kmod": "vfio-pci",
>     "pci_ids": [
>       {
>         "vendor": "8086",
>         "device": "0b25",
>         "subsystem_vendor": "ffff",
>         "subsystem_device": "ffff"
>       }
>     ]
>   }
> 
> Get only the required kernel modules for a given driver:
> 
>   ~$ usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | \
>     jq '.[] | select(.name == "net_i40e").kmod'
>   "* igb_uio | uio_pci_generic | vfio-pci"
> 
> Get only the required kernel modules for a given device:
> 
>   ~$ usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | \
>     jq '.[] | select(.pci_ids[] | .vendor == "15b3" and .device == "1013").kmod'
>   "* ib_uverbs & mlx5_core & mlx5_ib"
> 
> Print the list of drivers which define multiple parameters without
> string separators:
> 
>   ~$ usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | \
>     jq '.[] | select(.params!=null and (.params|test("=[^ ]+="))) | {name, params}'
>   ...
> 
> The script passes flake8, black, isort and pylint checks.
> 
> I have tested this with a matrix of python/pyelftools versions:
> 
>                               pyelftools
>                 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29
>           3.6     ok   ok   ok   ok   ok   ok   ok   ok
>           3.7     ok   ok   ok   ok   ok   ok   ok   ok
>    Python 3.8     ok   ok   ok   ok   ok   ok   ok   ok
>           3.9     ok   ok   ok   ok   ok   ok   ok   ok
>           3.10  fail fail fail fail   ok   ok   ok   ok
> 
> All failures with python 3.10 are related to the same issue:
> 
>    File "elftools/construct/lib/container.py", line 5, in <module>
>      from collections import MutableMapping
>    ImportError: cannot import name 'MutableMapping' from 'collections'
> 
> Python 3.10 support is only available since pyelftools 0.26. The script
> will only work with Python 3.6 and later. Update the minimal system
> requirements and release notes.
> 
> NB: The output produced by the legacy -r/--raw flag can be obtained with
> the following command:
> 
>    strings build/app/dpdk-testpmd | sed -n 's/^PMD_INFO_STRING= //p'
> 
> Cc: Olivier Matz <olivier.matz@6wind.com>
> Cc: Ferruh Yigit <ferruh.yigit@xilinx.com>
> Cc: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: Robin Jarry <rjarry@redhat.com>


For 'subsystem_vendor' & 'subsystem_device', the value "ffff" means it 
is not explicitly defined, so it gets default value.
What do you think to omit those as well, when value is "ffff", to reduce 
noise on the output?



BTW, I have detected some duplicates in the output, like [1], [2] & [3]. 
It seems related to the duplicates in the code, cc'ed maintainers.

[1]:
   {
     "name": "net_qede",
     "kmod": "* igb_uio | uio_pci_generic | vfio-pci",
     "pci_ids": [
       {
         "vendor": "1077",
         "device": "1634",
         "subsystem_vendor": "ffff",
         "subsystem_device": "ffff"
       },
       {
         "vendor": "1077",
         "device": "1629",
         "subsystem_vendor": "ffff",
         "subsystem_device": "ffff"
       },
       {
         "vendor": "1077",
         "device": "1634",
         "subsystem_vendor": "ffff",
         "subsystem_device": "ffff"
       },
...

[2]
   {
     "name": "mempool_cnxk",
     "params": "max_pools=<128-1048576>",
     "kmod": "vfio-pci",
     "pci_ids": [
       {
         "vendor": "177d",
         "device": "a0fb",
         "subsystem_vendor": "ffff",
         "subsystem_device": "b900"
       },
       {
         "vendor": "177d",
         "device": "a0fb",
         "subsystem_vendor": "ffff",
         "subsystem_device": "b900"
       },
...

[3]
   {
     "name": "net_cn10k",
     "kmod": "vfio-pci",
     "pci_ids": [
       {
         "vendor": "177d",
         "device": "a063",
         "subsystem_vendor": "ffff",
         "subsystem_device": "b900"
       },
       {
         "vendor": "177d",
         "device": "a063",
         "subsystem_vendor": "ffff",
         "subsystem_device": "b900"
       },
...

  reply	other threads:[~2022-09-20 10:10 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 10:58 [PATCH] " Robin Jarry
2022-09-13 11:29 ` Ferruh Yigit
2022-09-13 11:49   ` Robin Jarry
2022-09-13 13:50     ` Ferruh Yigit
2022-09-13 13:59       ` Robin Jarry
2022-09-13 14:17         ` Ferruh Yigit
2022-09-13 14:17 ` Bruce Richardson
2022-09-13 19:42 ` [PATCH v2] " Robin Jarry
2022-09-13 20:54   ` Ferruh Yigit
2022-09-13 21:22     ` Robin Jarry
2022-09-14 11:46       ` Ferruh Yigit
2022-09-15  9:18         ` Robin Jarry
2022-09-20  9:08 ` [PATCH v3] " Robin Jarry
2022-09-20 10:10   ` Ferruh Yigit [this message]
2022-09-20 10:12     ` Robin Jarry
2022-09-20 10:42 ` [PATCH v4] " Robin Jarry
2022-09-20 14:08   ` Olivier Matz
2022-09-20 17:48   ` Ferruh Yigit
2022-09-20 17:50     ` Ferruh Yigit
2022-09-21  7:27       ` Thomas Monjalon
2022-09-21  8:02         ` Ferruh Yigit
2022-09-20 19:15     ` Robin Jarry
2022-09-21  7:58       ` Ferruh Yigit
2022-09-21  9:57         ` Ferruh Yigit
2022-09-22 11:58 ` [PATCH v5] " Robin Jarry
2022-09-22 12:03   ` Bruce Richardson
2022-09-22 15:12   ` Ferruh Yigit
2022-09-26 11:55   ` Olivier Matz
2022-09-26 12:52   ` Robin Jarry
2022-09-26 13:44 ` [PATCH v6] " Robin Jarry
2022-09-26 15:17   ` Bruce Richardson
2022-09-28  6:51     ` Robin Jarry
2022-09-28 10:53       ` Bruce Richardson
2022-09-28 11:12         ` Robin Jarry
2022-10-04 19:29 ` [PATCH v7] " Robin Jarry
2022-10-10 22:44   ` Thomas Monjalon
2022-10-12 15:16     ` Olivier Matz
2022-10-12 16:16       ` Thomas Monjalon
2022-10-12 16:30         ` Robin Jarry
2022-10-12 16:44           ` Thomas Monjalon
2022-10-12 16:48             ` Robin Jarry
2022-10-12 20:40               ` 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=27a4885e-1fa3-9856-ccb2-e8bb82a96797@xilinx.com \
    --to=ferruh.yigit@xilinx.com \
    --cc=asekhar@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dsinghrawat@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=olivier.matz@6wind.com \
    --cc=pbhagavatula@marvell.com \
    --cc=rjarry@redhat.com \
    --cc=rmody@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.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).