|
Revision tags: v22.03, v22.03-rc4, v22.03-rc3, v22.03-rc2, v22.03-rc1, v21.11, v21.11-rc4, v21.11-rc3, v21.11-rc2, v21.11-rc1 |
|
| #
4976250e |
| 19-Oct-2021 |
David Marchand <[email protected]> |
usertools/pmdinfo: fix plugin auto scan
Migration to argparse was incomplete.
$ dpdk-pmdinfo.py -p $(which dpdk-testpmd) Traceback (most recent call last): File "/usr/bin/dpdk-pmdinfo.py", line 6
usertools/pmdinfo: fix plugin auto scan
Migration to argparse was incomplete.
$ dpdk-pmdinfo.py -p $(which dpdk-testpmd) Traceback (most recent call last): File "/usr/bin/dpdk-pmdinfo.py", line 626, in <module> main() File "/usr/bin/dpdk-pmdinfo.py", line 596, in main exit(scan_for_autoload_pmds(args[0])) TypeError: 'Namespace' object does not support indexing
Fixes: 81255f27c65c ("usertools: replace optparse with argparse") Cc: [email protected]
Signed-off-by: David Marchand <[email protected]> Reviewed-by: Robin Jarry <[email protected]>
show more ...
|
|
Revision tags: v21.08, v21.08-rc4, v21.08-rc3, v21.08-rc2, v21.08-rc1, v21.05, v21.05-rc4, v21.05-rc3, v21.05-rc2, v21.05-rc1, v21.02, v21.02-rc4, v21.02-rc3, v21.02-rc2, v21.02-rc1, v20.11, v20.11-rc5 |
|
| #
3515fa1e |
| 19-Nov-2020 |
Julien Massonneau <[email protected]> |
usertools: fix pmdinfo parsing
In the display_pmd_info_strings function, the script parses the section until to find a byte between 32 and 127, and get all data until a byte equals to 0. After, it s
usertools: fix pmdinfo parsing
In the display_pmd_info_strings function, the script parses the section until to find a byte between 32 and 127, and get all data until a byte equals to 0. After, it searches "PMD_INFO_STRING" in the data and passes the whole string in the parse_pmd_info_string function, which split the string with "=" and convert it in python dict with json.loads().
But the string may contain a "=" before "PMD_INFO_STRING", so it is not correctly split and will lead to an error (json.decoder.JSONDecodeError).
Example of a string encountered that leads to an error:
"Ag%=C£°ÐÊ+Ë®{0´wË-£0òjB·;¾¬úPMD_INFO_STRING= {"name" : "net_octeontx", "params" : "nr_port=<int> ", "pci_ids" : []}"
Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information") Cc: [email protected]
Signed-off-by: Julien Massonneau <[email protected]>
show more ...
|
|
Revision tags: v20.11-rc4, v20.11-rc3, v20.11-rc2 |
|
| #
d58360c6 |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: do not test empty with function len
Python lint warns about using len(SEQUENCE) to determine if sequence is empty.
Signed-off-by: Stephen Hemminger <[email protected]> Acked-by:
usertools: do not test empty with function len
Python lint warns about using len(SEQUENCE) to determine if sequence is empty.
Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Bruce Richardson <[email protected]>
show more ...
|
| #
81255f27 |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: replace optparse with argparse
The optparse module is deprecated and replaced with new argparse. Using the python standard argument parser instead of C library style getopt gives a number
usertools: replace optparse with argparse
The optparse module is deprecated and replaced with new argparse. Using the python standard argument parser instead of C library style getopt gives a number of advantages such as checking for conflicting arguments, restricting choices, and automatically generating help messages.
Some of the help messages are now less wordy.
The code now enforces the rule that only one of the pmdinfo formats can be specified: raw or json.
Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Bruce Richardson <[email protected]>
show more ...
|
| #
c358ba7a |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: fix indentation
Python lint complains about indentation and missing spaces around commas.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Stephen Hemminger
usertools: fix indentation
Python lint complains about indentation and missing spaces around commas.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Bruce Richardson <[email protected]>
show more ...
|
| #
55f58d7f |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: replace explicit boolean checks
Code reads better if unnecessary comparison with False and True is not used.
Signed-off-by: Stephen Hemminger <[email protected]>
|
| #
b5685e39 |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: remove unnecessary parens and else
Python lint complains: Unnecessary parens after 'if' keyword Unnecessary parens after 'not' keyword Unnecessary "else" after "return"
Signed-off-by: St
usertools: remove unnecessary parens and else
Python lint complains: Unnecessary parens after 'if' keyword Unnecessary parens after 'not' keyword Unnecessary "else" after "return"
Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Bruce Richardson <[email protected]>
show more ...
|
| #
5b8c1376 |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: replace io.open
The builtin open() is the recommended approach in python3. io.open was for compatibility with older versions.
Signed-off-by: Stephen Hemminger <[email protected]>
|
| #
ecdd4711 |
| 04-Nov-2020 |
Stephen Hemminger <[email protected]> |
usertools: replace string.split
In python3 the standard way to split strings is to use the split() on the string object itself. The old way is broken and would cause a traceback.
Signed-off-by: Ste
usertools: replace string.split
In python3 the standard way to split strings is to use the split() on the string object itself. The old way is broken and would cause a traceback.
Signed-off-by: Stephen Hemminger <[email protected]>
show more ...
|
| #
4760b32b |
| 04-Nov-2020 |
David Marchand <[email protected]> |
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 fi
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 to only parse DPDK drivers dependencies. While the reason is not clear from the commitlog of the patch that introduced this filter, it was probably added for performance reasons, since going through all dependencies can be quite long. Testing with a DPDK built before the driver name changes: - running the script takes ~0.3s with the filter, - running the script takes ~9s without the filter,
Now that we changed the driver library names, it becomes more difficult to identify only DPDK drivers, but we can just filter on the librte_ prefix to identify DPDK libraries: the script later checks for the PMD_INFO_STRING string in .rodata and it is enough to differentiate the DPDK drivers from the other DPDK libraries.
Running the script with this patch takes ~0.5s.
A debug message was logged for each inspected file, it gives no useful information and is removed.
Fixes: a20b2c01a7a1 ("build: standardize component names and defines")
Signed-off-by: David Marchand <[email protected]> Acked-by: Robin Jarry <[email protected]> Acked-by: Bruce Richardson <[email protected]>
show more ...
|
|
Revision tags: v20.11-rc1 |
|
| #
3f6f8362 |
| 30-Sep-2020 |
Louise Kilheeney <[email protected]> |
support python 3 only
Changed scripts to explicitly use Python 3 only, to avoid maintaining Python 2. Removed deprecation notices.
Signed-off-by: Louise Kilheeney <[email protected]> Signe
support python 3 only
Changed scripts to explicitly use Python 3 only, to avoid maintaining Python 2. Removed deprecation notices.
Signed-off-by: Louise Kilheeney <[email protected]> Signed-off-by: Kevin Laatz <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Robin Jarry <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Acked-by: Ray Kinsella <[email protected]>
show more ...
|
|
Revision tags: v20.08, v20.08-rc4, v20.08-rc3, v20.08-rc2, v20.08-rc1 |
|
| #
ea0dceba |
| 10-Jul-2020 |
Louise Kilheeney <[email protected]> |
add python2 deprecation notice
Prepare for python2 removal in 20.11.
Signed-off-by: Louise Kilheeney <[email protected]> Acked-by: Neil Horman <[email protected]> Acked-by: Nicolas Cha
add python2 deprecation notice
Prepare for python2 removal in 20.11.
Signed-off-by: Louise Kilheeney <[email protected]> Acked-by: Neil Horman <[email protected]> Acked-by: Nicolas Chautru <[email protected]>
show more ...
|
|
Revision tags: v20.05, v20.05-rc4, v20.05-rc3, v20.05-rc2, v20.05-rc1 |
|
| #
2ad9f1fa |
| 12-Mar-2020 |
Luca Boccassi <[email protected]> |
usertools: check for pci.ids in /usr/share/misc
Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc, and the former is just a compat symlink now. We are starting to get bu
usertools: check for pci.ids in /usr/share/misc
Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc, and the former is just a compat symlink now. We are starting to get bug reports to nudge us into changing. So check the new path first, and the old one as a fallback.
Cc: [email protected]
Signed-off-by: Luca Boccassi <[email protected]> Acked-by: David Marchand <[email protected]>
show more ...
|
|
Revision tags: v20.02, v20.02-rc4, v20.02-rc3 |
|
| #
e1766e7b |
| 12-Feb-2020 |
Thomas Faivre <[email protected]> |
usertools: fix syntax warning in python 3.8
Silent the following warning when running script with python 3.8:
> /usr/bin/dpdk-pmdinfo:542: SyntaxWarning: "is" with a literal. > Did you mean "=="? >
usertools: fix syntax warning in python 3.8
Silent the following warning when running script with python 3.8:
> /usr/bin/dpdk-pmdinfo:542: SyntaxWarning: "is" with a literal. > Did you mean "=="? > if (autoload_path is None or autoload_path is ""):
As autoload_path can only be None or a string, directly check its bool value.
Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information") Cc: [email protected]
Signed-off-by: Thomas Faivre <[email protected]>
show more ...
|
|
Revision tags: v20.02-rc2, v20.02-rc1, v19.11, v19.11-rc4, v19.11-rc3, v19.11-rc2, v19.11-rc1 |
|
| #
4da06919 |
| 15-Oct-2019 |
Robin Jarry <[email protected]> |
usertools: fix pmdinfo with python 3 and pyelftools>=0.24
Running dpdk-pmdinfo.py on Ubuntu 18.04 (bionic) with python 3 and pyelftools installed produces no output but no error is reported neither:
usertools: fix pmdinfo with python 3 and pyelftools>=0.24
Running dpdk-pmdinfo.py on Ubuntu 18.04 (bionic) with python 3 and pyelftools installed produces no output but no error is reported neither:
~$ python3 usertools/dpdk-pmdinfo.py -r build/app/testpmd ~$ echo $? 0
While with python 2, it works:
~# python2 usertools/dpdk-pmdinfo.py -r build/app/testpmd {"pci_ids": [], "name": "dpio"} {"pci_ids": [], "name": "dpbp"} {"pci_ids": [], "name": "dpaa2_qdma"} .....
On Ubuntu 18.04, pyelftools is version 0.24. The change log of pyelftools v0.24 says:
- Symbol/section names are strings internally now, not bytestrings (this may affect API usage in Python 3) (#76).
We cannot guess which version of pyelftools is actually being used. The elftools.__version__ symbol is not consistent with each distro's package version. For example, on Ubuntu 16.04 (xenial), the .deb package version is '0.23-2' but elftools.__version__ contains '0.25'. This is certainly due to partial backports.
To have a more consistent behaviour of this script across all versions of python, add the unicode_literals future import so that literal strings are now always "unicode".
Add 2 utility functions to force a string into bytes or bytes into an unicode string.
Force pyelftools return values to unicode strings (will do nothing with recent version of pyelftools).
If elffile.get_section_by_name returns None with a unicode section name, try with the same one encoded as bytes.
Also, replace all open() calls by io.open() which behaves like the builtin open in python 3. The only non-binary opened file is /usr/share/hwdata/pci.ids which is UTF-8 encoded text. Explicitly specify that encoding.
Link: https://github.com/eliben/pyelftools/blob/v0.24/CHANGES#L7 Link: https://github.com/eliben/pyelftools/commit/108eaea9e75a8b5a
Fixes: 54ca545dce4b ("make python scripts python2/3 compliant") Cc: [email protected]
Signed-off-by: Robin Jarry <[email protected]> Reviewed-by: Olivier Matz <[email protected]>
show more ...
|
|
Revision tags: v19.08, v19.08-rc4, v19.08-rc3, v19.08-rc2, v19.08-rc1, v19.05, v19.05-rc4, v19.05-rc3, v19.05-rc2, v19.05-rc1, v19.02, v19.02-rc4, v19.02-rc3, v19.02-rc2, v19.02-rc1, v18.11, v18.11-rc5, v18.11-rc4, v18.11-rc3, v18.11-rc2, v18.11-rc1, v18.08, v18.08-rc3, v18.08-rc2, v18.08-rc1, v18.05, v18.05-rc6, v18.05-rc5, v18.05-rc4, v18.05-rc3, v18.05-rc2, v18.05-rc1 |
|
| #
0a56e151 |
| 09-Apr-2018 |
Hemant Agrawal <[email protected]> |
usertools: add missing SPDX identifier
Signed-off-by: Hemant Agrawal <[email protected]> Acked-by: Neil Horman <[email protected]>
|
|
Revision tags: v18.02, v18.02-rc4, v18.02-rc3, v18.02-rc2, v18.02-rc1, v17.11, v17.11-rc4, v17.11-rc3, v17.11-rc2, v17.11-rc1, v17.08, v17.08-rc4, v17.08-rc3, v17.08-rc2, v17.08-rc1, v17.05, v17.05-rc4, v17.05-rc3, v17.05-rc2, v17.05-rc1, v17.02, v17.02-rc3, v17.02-rc2, v17.02-rc1 |
|
| #
c6dab2a8 |
| 15-Dec-2016 |
Thomas Monjalon <[email protected]> |
tools: move to usertools
Rename tools/ into usertools/ to differentiate from buildtools/ and devtools/ while making clear these scripts are part of DPDK runtime.
Signed-off-by: Thomas Monjalon <tho
tools: move to usertools
Rename tools/ into usertools/ to differentiate from buildtools/ and devtools/ while making clear these scripts are part of DPDK runtime.
Signed-off-by: Thomas Monjalon <[email protected]> Tested-by: Ferruh Yigit <[email protected]>
show more ...
|