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).
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
* Also tested on FreeBSD
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, docs and release notes.
Signed-off-by: Robin Jarry <rjarry@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Per mount(8), the previous owner and mode of the mount point
become invisible as long as this filesystem remains mounted.
Because dpdk-hugepages.py must be run as root,
the new owner would be root.
This is undesirable if the hugepage directory is being set up
by the administrator for an unprivileged user.
HugeTLB filesystem has options to set the mount point owner.
Add --user/-U and --group/-G options to apply this when mounting.
The benefit of performing this in dpdk-hugepages.py
is that the user does not need to care about this detail
of mount command operation.
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when using hugepages of multiple sizes in different
directories or when granting different permissions to mount points.
Add --directory/-d option to the script.
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Systemd.exec supports configuring the runtime directory of a service
via RuntimeDirectory=. This creates the directory with the necessary
permissions which actual service may not have if running in container.
The change to DPDK is to look for the environment RUNTIME_DIRECTORY
first and use that in preference to the fallback alternatives.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
As per the deprecation notice, In the view of enabling unified driver
for octeontx2(cn9k)/octeontx3(cn10k), removing drivers/octeontx2
drivers and replace with drivers/cnxk/ which
supports both octeontx2(cn9k) and octeontx3(cn10k) SoCs.
This patch does the following
- Replace drivers/common/octeontx2/ with drivers/common/cnxk/
- Replace drivers/mempool/octeontx2/ with drivers/mempool/cnxk/
- Replace drivers/net/octeontx2/ with drivers/net/cnxk/
- Replace drivers/event/octeontx2/ with drivers/event/cnxk/
- Replace drivers/crypto/octeontx2/ with drivers/crypto/cnxk/
- Rename config/arm/arm64_octeontx2_linux_gcc as
config/arm/arm64_cn9k_linux_gcc
- Update the documentation and MAINTAINERS to reflect the same.
- Change the reference to OCTEONTX2 as OCTEON 9. Old release notes and
the kernel related documentation is not accounted for this change.
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
The octeontx2_dma rawdev driver is removed in DPDK-21.11. The new driver
for the same device uses the dmadev. So this patch updates the device
naming and lists it under dma devices section.
Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
This fixes most of the warnings from the Flake8 style checker.
The ones remaining are long lines (we allow > 79 characters)
and a line break warning. The line break style changed in later
versions of PEP 8 and the tool is not updated.
https://www.flake8rules.com/rules/W503.html
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
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: 81255f27c6 ("usertools: replace optparse with argparse")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Robin Jarry <robin.jarry@6wind.com>
The dmadev library is the preferred abstraction for using IDXD devices and
will replace the rawdev implementation in future. This patch moves the IDXD
device ID to the dmadev class.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Add a new class for DMA devices.
Devices listed under the DMA class are to be used with the dmadev library.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
This patch adds the option --list (-l) to dpdk-telemetry.py which will
print all of the available file-prefixes for DPDK processes that have
telemetry enabled.
The prefixes will also be printed if the user passes an incorrect prefix
in the --file-prefix (-f) option.
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
The instance option help text was incorrect, this patch corrects it.
Fixes: 11435aae20 ("usertools/telemetry: connect to separate instances")
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
When a user runs the dpdk-telemetry script and fails to connect because
the socket path does not exist, run a scan for possible sockets that
could be connected to and inform the user of the command needed to
connect to those.
For example:
$ ./dpdk-telemetry.py -i4
Connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4
Error connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4
Other DPDK telemetry sockets found:
- dpdk_telemetry.v2 # Connect with './dpdk-telemetry.py'
- dpdk_telemetry.v2:2 # Connect with './dpdk-telemetry.py -i 2'
- dpdk_telemetry.v2:1 # Connect with './dpdk-telemetry.py -i 1'
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
For processes run using "in-memory" mode sharing the same runtime dir,
we add support for connecting to the separate instance sockets created
using ":1", ":2" etc. via new "-i" or "--instance" argument. Add details
on connecting to separate instances to the telemetry howto document.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
Add support for inline inbound and outbound IPSec for SA create,
destroy and other NIX / CPT LF configurations.
This patch also changes dpdk-devbind.py to list new inline
device as misc device.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
When the input to the script is coming from a device which is not a TTY
then we become less verbose and skip the prompts and helpful messages
about what is happening.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
To allow the script to take queries from input pipes e.g. "echo
/ethdev/stats,0 | dpdk-telemetry.py", we need to handle the case of EOF
correctly without crashing with an exception. Do this by using a
try-except block around the input handling.
Fixes: 6a2967c112 ("usertools: add new telemetry script")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Add baseband phy skeleton driver. Baseband phy is a hardware subsystem
accelerating 5G/LTE related tasks. Note this driver isn't involved into
any sort baseband protocol processing. Instead it just provides means
for configuring hardware.
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Add baseband PHY CGX/RPM skeleton driver which merely probes a matching
device. CGX/RPM are Ethernet MACs hardwired to baseband subsystem.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Add DLB to usertools/dpdk-devbind.py so that it shows up
as an eventdev, and is identified as Intel DLB.
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Switch from using tabs to 4 spaces for meson.build indentation, for the
basic infrastructure and tooling files, as well as doc and kernel
directories.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
In case the number of requested hugepages cannot be set,
a more detailed error message is printed.
The new message does not mention "reserve" because setting
can be reserving or clearing.
The filename and numbers requested/set are printed to ease debugging.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
The default page size can be None, and the page size from user request
can be 0 kB if lower than 1024. In these cases, a division will fail.
In order to avoid a Python exception, the page size is checked
and an error message "Invalid page size" is printed.
A similar error message is printed in set_hugepages()
if the size is not supported, except at this stage the message can be
completed with "Valid page sizes".
Unfortunately the first check is too early to print such information.
A third error message can be printed in a different place (get_memsize)
in case of a format issue, e.g. a negative size.
The function get_memsize() is also used for total requested size,
so the error message "not a valid page size" was potentially wrong.
This message is replaced with the more general "is not a valid size".
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
When the dpdk-telemetry client connects to a DPDK instance, we can use the
PID provided in the initial connection message to query from /proc the name
of the process we are connected to, and display that to the user. We use
the "cmdline" procfs entry for the query since that is available on both
Linux and FreeBSD (assuming procfs is mounted on the BSD instance).
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Currently the dpdk-telemetry.py script connects to all running DPDK apps
consecutively. With the addition of this file-prefix argument, we can limit
the amount of information returned providing improved consumability and
precision to the user.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
A driver can be loaded as a dynamic module or a built-in module.
In commit 681a672886 ("usertools: check if module is loaded
before binding"), the script only checks modules in /sys/module/.
However, for built-in kernel driver, it only shows up in /sys/module/,
if it has a version or at least one parameter. So add check for
modules in /lib/modules/$(uname -r)/modules.builtin.
Fixes: 681a672886 ("usertools: check if module is loaded before binding")
Cc: stable@dpdk.org
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
If user requests a hugepage size which is not supported by the system,
currently user gets an error message saying that the requested size
is not a valid system huge page size. In addition to this if we display
the valid hugepage sizes it will be convenient for the user to request
the right size next time.
Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
script displays no error message hence the user can be under the delusion
that the hugepages requested are all successfully reserved. This patch
displays an error message if the pages reserved are different from the
requested pages.
Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory. Here is an example on an IBM AC922 system:
$ lscpu
...
NUMA node0 CPU(s): 0-63
NUMA node8 CPU(s): 64-127
NUMA node252 CPU(s):
...
$ numastat -m
...
Node 0 Node 8 Node 252
--------------- --------------- ---------------
MemTotal 126763.19 130785.06 0.00
MemFree 119513.38 125294.44 0.00
MemUsed 7249.81 5490.62 0.00
...
HugePages_Total 4.00 1734.00 0.00
HugePages_Free 0.00 4.00 0.00
HugePages_Surp 4.00 1730.00 0.00
...
Modify dpdk-hugepages.py to test for the ../hugepages directory before
attempting to parse the hugepage entries.
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
This old script relied on deprecated stuff, and especially make.
It also applied some scary 666 permissions on files under /dev/vfio.
Its deprecation had been notified in a previous release, remove it.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
The "misc" and "regex" device classes were missing from the list used to
check arguments, preventing them from being used with "--status-dev"
flag to list only devices of those types.
When adding them to the list, the list is also sorted alphabetically for
consistency.
Bugzilla ID: 582
Fixes: 81255f27c6 ("usertools: replace optparse with argparse")
Reported-by: Wei Ling <weix.ling@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Yu Jiang <yux.jiang@intel.com>
This is an improved version of the setup of huge pages
bases on earlier DPDK setup.
Differences are:
* autodetects NUMA vs non NUMA
* allows setting different page sizes
recent kernels support multiple sizes.
* accepts a parameter in bytes (not pages).
* can display current hugepage settings.
Most users will just use --setup argument but if necessary
the steps of clearing old settings and mounting/umounting
can be done individually.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
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: c67c9a5c64 ("tools: query binaries for HW and other support information")
Cc: stable@dpdk.org
Signed-off-by: Julien Massonneau <julien.massonneau@6wind.com>
Python lint suggests using in instead of multiple comparisons.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Address python lint complaints about unused imports.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint warns about using len(SEQUENCE) to determine if sequence is empty.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
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 <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint complains about indentation and missing spaces around commas.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint complains:
Unnecessary parens after 'if' keyword
Unnecessary parens after 'not' keyword
Unnecessary "else" after "return"
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The builtin open() is the recommended approach in python3.
io.open was for compatibility with older versions.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
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 <stephen@networkplumber.org>
The pycodestyle tool flagged the following issues, which are now fixed.
$ pycodestyle cpu_layout.py
cpu_layout.py:18:5: E722 do not use bare 'except'
cpu_layout.py:62:14: E231 missing whitespace after ','
Fixes: deb87e6777 ("usertools: use sysfs for CPU layout")
Fixes: c9208f1dc9 ("usertools: fix CPU layout with python 3")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
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: a20b2c01a7 ("build: standardize component names and defines")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Update the devbind script with new section of regex devices, also
added OCTEONTX2 REE device ID to regex device list
Signed-off-by: Guy Kaneti <guyk@marvell.com>
Intel Data Streaming Accelerator (Intel DSA) is a high-performance data
copy and transformation accelerator which will be integrated in future
Intel processors [1].
Add DSA device support to dpdk-devbind.py script.
[1] https://01.org/blogs/2019/introducing-intel-data-streaming-accelerator
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>