|
Packit |
2f40ff |
driverctl is a device driver control utility for Linux
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Description
|
|
Packit |
2f40ff |
-----------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
driverctl is a tool for manipulating and inspecting the system
|
|
Packit |
2f40ff |
device driver choices.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Devices are normally assigned to their sole designated kernel driver
|
|
Packit |
2f40ff |
by default. However in some situations it may be desireable to
|
|
Packit |
2f40ff |
override that default, for example to try an older driver to
|
|
Packit |
2f40ff |
work around a regression in a driver or to try an experimental alternative
|
|
Packit |
2f40ff |
driver. Another common use-case is pass-through drivers and driver
|
|
Packit |
2f40ff |
stubs to allow userspace to drive the device, such as in case of
|
|
Packit |
2f40ff |
virtualization.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
driverctl integrates with udev to support overriding
|
|
Packit |
2f40ff |
driver selection for both cold- and hotplugged devices from the
|
|
Packit |
2f40ff |
moment of discovery, but can also change already assigned drivers,
|
|
Packit |
2f40ff |
assuming they are not in use by the system. The driver overrides
|
|
Packit |
2f40ff |
created by driverctl are persistent across system reboots
|
|
Packit |
2f40ff |
by default.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
License
|
|
Packit |
2f40ff |
-------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Licensed under the GNU Lesser General Public License aka LGPL v2.1.
|
|
Packit |
2f40ff |
See COPYING for details.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Source repository
|
|
Packit |
2f40ff |
-----------------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
git clone https://gitlab.com/driverctl/driverctl.git
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
System requirements
|
|
Packit |
2f40ff |
-------------------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
- udev, tested with versions >= 219 but older versions are likely
|
|
Packit |
2f40ff |
to work as well
|
|
Packit |
2f40ff |
- kernel >= 3.16 or backported support for driver_override device
|
|
Packit |
2f40ff |
binding path:
|
|
Packit |
2f40ff |
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=782a985d7af26db39e86070d28f987cad21313c0
|
|
Packit |
2f40ff |
- bash-completion (optional)
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Installation
|
|
Packit |
2f40ff |
------------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
"make rpm" should create a working package to be installed for those on
|
|
Packit |
2f40ff |
rpm-based distros (tested on recent Fedora and RHEL 7), others should
|
|
Packit |
2f40ff |
be able to use "make install" (but note there's no "uninstall" target)
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Usage
|
|
Packit |
2f40ff |
-----
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Find devices currently driven by ixgbe driver:
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
# driverctl -v list-devices | grep ixgbe
|
|
Packit |
2f40ff |
0000:01:00.0 ixgbe (Ethernet 10G 4P X520/I350 rNDC)
|
|
Packit |
2f40ff |
0000:01:00.1 ixgbe (Ethernet 10G 4P X520/I350 rNDC)
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Change them to use the vfio-pci driver:
|
|
Packit |
2f40ff |
# driverctl set-override 0000:01:00.0 vfio-pci
|
|
Packit |
2f40ff |
# driverctl set-override 0000:01:00.1 vfio-pci
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Find devices with driver overrides:
|
|
Packit |
2f40ff |
# driverctl -v list-overrides
|
|
Packit |
2f40ff |
0000:01:00.0 vfio-pci (Ethernet 10G 4P X520/I350 rNDC)
|
|
Packit |
2f40ff |
0000:01:00.1 vfio-pci (Ethernet 10G 4P X520/I350 rNDC)
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Find network devices:
|
|
Packit |
2f40ff |
# driverctl list-devices network
|
|
Packit |
2f40ff |
0000:01:00.0 ixgbe
|
|
Packit |
2f40ff |
0000:01:00.1 ixgbe
|
|
Packit |
2f40ff |
0000:06:00.0 igb
|
|
Packit |
2f40ff |
0000:06:00.1 igb
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Remove the override from slot 0000:01:00.1:
|
|
Packit |
2f40ff |
# driverctl unset-override 0000:01:00.1
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Extras
|
|
Packit |
2f40ff |
------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
In addition to the actual driverctl utility, udev rules to expose
|
|
Packit |
2f40ff |
VFIO and UIO devices on systemd level are included to make them
|
|
Packit |
2f40ff |
dependable for services.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Since the vfio device naming is based on IOMMU groups it is rather
|
|
Packit |
2f40ff |
unpredictable on the outset: for example on my laptop the NIC at
|
|
Packit |
2f40ff |
PCI slot 0000:00:19.0 would appear as /sys/devices/virtual/vfio/3
|
|
Packit |
2f40ff |
when bound to the vfio_pci driver. To make this more discoverable,
|
|
Packit |
2f40ff |
systemd aliases are added so the device is additionally addressable
|
|
Packit |
2f40ff |
by its PCI slot name, in this example it'd be:
|
|
Packit |
2f40ff |
sys-devices-pci0000:00-0000:00:19.0-vfio.device.
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Contributing etc
|
|
Packit |
2f40ff |
----------------
|
|
Packit |
2f40ff |
|
|
Packit |
2f40ff |
Patches, bug reports and other feedback are welcome via the
|
|
Packit |
2f40ff |
project page: https://gitlab.com/driverctl/driverctl
|
|
Packit |
2f40ff |
|