Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.
Today, most PCI drivers require uio/vfio.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adding the support to bind/unbind crypto devices with
dpdk-devbind.py script, as now it is not restricted
to network devices anymore.
Signed-off-by: Eoin Breen <eoin.breen@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
The dpdk-devbind.py script does not find/display the ifname for virtio
interfaces since the "net" directory is not directly under the device
directory but rather under a subdirectory.
eg.
> dpdk-devbind.py --status
0000:00:03.0 'Virtio network device' if= drv=virtio-pci unused=
This change searches for the first "net" directory under the device
directory hierarchy.
eg.
0000:00:03.0 'Virtio network device' if=ens3 drv=virtio-pci unused=
Fixes: 629395b063 ("igb_uio: remove PCI id table")
Signed-off-by: Gary Mussar <gmussar@ciena.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Using dpdk-pmdinfo with the '-r' flag does not produce a json output as
documented. Instead, the python representation of the json object is
shown, which is nearly the same, but cannot be properly parsed by a json
parser.
python repr (before):
{u'pci_ids': [[5549, 1968, 65535, 65535]], u'name': u'vmxnet3'}
json (after):
{"pci_ids": [[5549, 1968, 65535, 65535]], "name": "vmxnet3"}
Fixes: c67c9a5c64 ("tools: query binaries for HW and other support information")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
The following tools may be installed system-wide.
It may be cleaner and more convenient to find them with the same
dpdk- prefix (especially for autocompletion).
Moreover, the script dpdk_nic_bind.py deserves a new name because it is
not restricted to NICs and can be used for e.g. crypto.
These files are renamed:
pmdinfogen -> dpdk-pmdinfogen
pmdinfo.py -> dpdk-pmdinfo.py
dpdk_pdump -> dpdk-pdump
dpdk_proc_info -> dpdk-procinfo
dpdk_nic_bind.py -> dpdk-devbind.py
setup.sh -> dpdk-setup.sh
The tools pmdinfogen, pmdinfo.py and dpdk_pdump are new in 16.07.
The scripts dpdk_nic_bind.py and setup.sh may have been used with
previous releases by end users. That's why a symbolic link still
provide the old name in the installed tools directory.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
There were a couple of issues which prevented pmdinfo.py from running on
FreeBSD, both of which are fixed by this patch.
* The path to python is not /usr/bin/python as on Linux, so use
/usr/bin/env to find it on both OS's.
* The path to the pci ids DB is in a different location on FreeBSD,
so use the platform python library to look in different default
locations depending on the underlying OS. [There are two possible
locations to look on FreeBSD, as defined by pciconf manpage, so
check in both in order of better to worse]
Fixes: c67c9a5c64 ("tools: query binaries for HW and other support information")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
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
If a file is specified with no path, it is assumed to be a PMD DSO, and the
LD_LIBRARY_PATH, /usr/lib[64]/ and /lib[64] is searched for it
Currently the tool can output data in 3 formats:
a) raw, suitable for scripting, where the raw JSON strings are dumped out
b) table format (default) where hex pci ids are dumped in a table format
c) pretty, where a user supplied pci.ids file is used to print out vendor
and device strings
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Remy Horton <remy.horton@intel.com>
dpdk_nic_bind will only handle Ethernet devices, but Mellanox ConnectX-3 Pro,
for example, is a Network class device, but not an Ethernet one. Even though
this allows other devices in the list, like Wireless devices, this should not be
a problem.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
probe the kernel module existence through /sys/module/ to make it work
with both module and inbuilt kernel module
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
flake8 checks were run for both python 2.7 and 3.4
There were some style issues as:
- Line width > 79
- No double blank line before function definition
- No double blank space before inline comment
- Some other minor issues
Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: John McNamara <john.mcnamara@intel.com>
The output for the core list included an extra linefeed making
the number of lines displayed much larger then required.
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Currently dpdk_nic_bind.py detects Linux kernel modules via reading
/proc/modules. Built-in ones aren't listed there and therefore they are
not being found by the script.
Add support for checking built-in modules with parsing the sysfs files.
This commit obsoletes the /proc/modules parsing approach.
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
This patch fixes syntax errors during binding ethernet device
on systems where Python 3 is default.
Backward compatibility with Python 2 is preserved.
Signed-off-by: Dawid Jurczak <dawid_jurek@vp.pl>
We should call sys.exit(), not divide sys by exit().
Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The multi-target install create some subdirectories with the target name
which is not standard for a "make install" procedure.
The uninstall procedure cannot be applied properly (without removing
all files in a directory). It would need to pre-compute paths.
As it is a packaging issue, it is removed from the build system capabilities.
The variable BUILD_DIR is also renamed to RTE_OUTPUT used in other files.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
This patch adds -s as an alias to --status in dpdk_nic_bind.py,
providing a convenient shorthand.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Exit tools/setup.sh script without prompting "Press enter to continue".
The script can now be exited by typing the option number, "quit" or "q".
Signed-off-by: John McNamara <john.mcnamara@intel.com>
The function documentation was obviously copied and not updated.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This patch fixes several minor issues in setup.sh:
- show_nics() would not display the current Ethernet settings if
the user only loads the vfio-pci module, b/c it only checks for
presence of igb_uio. Fix this by adding a check for vfio-pci.
- unbind_nics(): Fix option naming and string inside function.
- Exchange a forgotten "igb_uio" with "vfio-pci" in a comment.
Signed-off-by: Andre Richter <andre.o.richter@gmail.com>
setup.sh uses /usr/bin/chmod, but depending on distribution, it is not always there.
For example, Ubuntu has /bin/chmod. Fix this by removing the absolute path, like it is
done e.g. with grep.
Signed-off-by: Andre Richter <andre.o.richter@gmail.com>
The dpdk_nic_bind script will not allow ports to be bound or unbound if none of the
kernel modules supported by DPDK is loaded. This patch relaxes this restriction by
checking if a DPDK module is actually requested. The example below illustrates this
problem:
In virtio test, on the guest
1. Bind virtio port to igb_uio driver;
2. Remove igb_uio module;
3. Bind virtio port to virtio-pci driver, it fails and reports:
"Error - no supported modules are loaded"
The script should check the to-be-bound driver flag, if it is dpdk driver(igb_uio, vfio etc),
and the corresponding module is not loaded, then exit, otherwise, just report a warning,
and continue to bind the non-dpdk driver(like virtio-pci) to dev.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Add uio_pci_generic to the list of supported kernel drivers.
Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Tested-by: Qun Wan <qun.wan@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
script was expecting /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko
but in fedora 21 there are Compressed kernel modules - xz (LZMA)
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Allow the nic bind/unbind script to print out its status messages even
if the igb_uio driver is not loaded. For binding and unbinding NICs, the
behaviour is the same, and the igb_uio driver still needs to be loaded.
Signed-off-by: Bruce richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
When binding devices to a generic driver (i.e. one that doesn't have a
PCI ID table, some devices that are not bound to any other driver could
be bound even if no one has asked them to. hence, we check the list of
drivers again, and see if some of the previously-unbound devices were
erroneously bound. if such devices are found, they are unbound back.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Bug: when "core id" is greater than 9, the cpu_layout.py output doesn't align.
Socket 0 Socket 1
--------- ---------
Core 9 [4, 16] [10, 22]
Core 10 [5, 17] [11, 23]
Solution: adjust output format to align based on the maximum length of the "core id" and "processor"
Socket 0 Socket 1
-------- --------
Core 9 [4, 16] [10, 22]
Core 10 [5, 17] [11, 23]
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Renaming the igb_uio_bind script to dpdk_nic_bind to have a generic name
before supporting two drivers.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Removing PCI ID list to make igb_uio more similar to a generic driver
like vfio-pci or pci_uio_generic. This is done to make it easier for
the binding script to support multiple drivers.
Note that since igb_uio no longer has a PCI ID list, it can now be
bound to any device, not just those explicitly supported by DPDK. In
other words, it now behaves similar to PCI stub, VFIO and other generic
PCI drivers.
Therefore to bind a new device to igb_uio, the user will now have to
first write its PCI ID to "new_id" file inside the igb_uio driver
directory, and only then write the PCI ID to "bind". This is reflected
in changes to PCI binding script as well.
There's a weird behaviour of sysfs when a new device ID is added to
new_id. Subsequent writing to "bind" will result in IOError on
closing the file. This error is harmless but it triggers the
exception anyway, so in order to work around that, we check if the
device was actually bound to the driver before raising an error.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: HuilongX Xu <huilongx.xu@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit removes trailing whitespace from lines in files. Almost all
files are affected, as the BSD license copyright header had trailing
whitespace on 4 lines in it [hence the number of files reporting 8 lines
changed in the diffstat].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove spaces before tabs in libs]
[Thomas: remove more trailing spaces in non-C files]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
In order to make this tool available among other system commands,
the name must be more specific.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Chris Wright <chrisw@redhat.com>