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>