The following sequence of operation gives error in binding devices
1) Bind a device using dpdk-devbind.py
2) Unbind the device using kernel tools(/sys/bus/pci/device/driver/unbind)
3) Bind the device using kernel tools(/sys/bus/pci/driver/new_id and
/sys/bus/pci/driver/bind)
The bind failure was due to cached driver name in 'driver_override'.
Fix it by writing 'null' to driver_override just after binding a
device so that any method of binding/unbinding can be used.
Fixes: 2fc3502935 ("usertools: use optimized driver override scheme to bind")
Reported-by: Lijuan A Tu <lijuanx.a.tu@intel.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
This patch creates the framework to define the DPDK PCI functional
device by specifying the pci attributes like Vendor ID, Device ID,
Sub Vendor ID, Sub Device ID and Class.This enables a flexible way to
add DPDK function devices based on PCI attributes.
Crypto devices can belong to Encryption class(0x10) or Processor
class(0x0b) based on the vendor preference.
Using this framework, The above disparity can be encoded in the following
format
encryption_class = [{'Class': '10', 'Vendor': None,
'Device': None, 'SVendor': None, 'SDevice': None}]
intel_processor_class = [{'Class': '0b', 'Vendor': '8086', 'Device': None,
'SVendor': None, 'SDevice': None}]
crypto_devices = [encryption_class, intel_processor_class]
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
The current device bind model uses /sys/bus/pci/driver/new_id scheme to
bind devices to the driver. This scheme has following operations to bind
a device to the driver.
1) Write device ID and vendor ID to /sys/bus/pci/driver/new_id
2) Write PCI BDF number to /sys/bus/pci/driver/bind
3) On step (1), _All_ the devices that match the device ID and vendor ID
get bound to the driver
4) Except for requested devices, Unbind the remaining devices
In kernels >= 3.15, An alternative scheme driver_override can be used to
bind a device to driver.This scheme has following operations to bind a
device to driver.
1) Write driver to /sys/bus/pci/device/driver_override
2) Write PCI BDF number to /sys/bus/pci/driver/bind
This script detects the presence of /sys/bus/pci/device/driver_override,
if available use optimized bind scheme to bind it
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
lspci invoked twice over all the pci devices in the system.
The first pass is to extract Numeric IDs and second pass to get extended
device details.
As an optimization, Used lspci with -nn option in get_device_details()
to obtain Numeric ID and extended device details in one shot.
In addition to this, After binding the PCI device, lspci needs to be
invoked again to confirm the proper bind operation. Used a boolean
argument to express this case in get_pci_device_details()
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Identified and parameterized the common code in show_status() function as
show_device_status().This will enable to avoid code duplication when
additional devices added to the script.
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
get_nic_details() and get_crypto_details() shares a lot of common code.
Created a new unified get_device_details() function get the device details.
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Some platforms do not have core/socket info in /proc/cpuinfo.
Use /sys/devices/system/cpu instead.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
When adding crypto devices, the "Active" and "Ssh_if" attributes of
existing network devices were reset. This causes the following issues:
- Network interfaces aren't marked as "*Active*" in the --status output.
- Active network interfaces can be unbound without the --force option,
causing loss of network connection.
The reset was caused by the call to devices[d].update in
get_crypto_details.
This patch prevents the update on non-crypto devices.
Fixes: cb4a1d14bf ("tools: bind crypto devices")
Cc: stable@dpdk.org
Signed-off-by: Yoni Gilad <yonig@radcom.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
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 <thomas.monjalon@6wind.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>