summaryrefslogtreecommitdiff
path: root/usertools
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2017-05-04 15:10:50 +0100
committerThomas Monjalon <thomas@monjalon.net>2017-07-06 00:53:15 +0200
commit657c7133854b4f209a8fc3ebd7f978bcd3353b63 (patch)
tree2d97738ad4df99c60fa3cff1134d40efbfaf9139 /usertools
parenta1e7c17555e8f77d520ba5f06ed26c00e77a2bd1 (diff)
downloaddpdk-next-eventdev-657c7133854b4f209a8fc3ebd7f978bcd3353b63.zip
dpdk-next-eventdev-657c7133854b4f209a8fc3ebd7f978bcd3353b63.tar.gz
dpdk-next-eventdev-657c7133854b4f209a8fc3ebd7f978bcd3353b63.tar.xz
usertools: add option to unbind all devices
-u accepts "dpdk" argument to unbind all devices bound to a DPDK driver. Usage: usertools/dpdk-devbind.py -u dpdk Example: $ usertools/dpdk-devbind.py -s Network devices using DPDK-compatible driver ============================================ 0000:08:00.1 '...' drv=igb_uio unused= 0000:81:00.0 '...' drv=igb_uio unused= 0000:88:00.0 '...' drv=igb_uio unused= 0000:88:00.1 '...' drv=igb_uio unused= ... $ usertools/dpdk-devbind.py -u dpdk $ usertools/dpdk-devbind.py -s Network devices using DPDK-compatible driver ============================================ <none> .... Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'usertools')
-rwxr-xr-xusertools/dpdk-devbind.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index f0225b6..da6e40c 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -518,6 +518,14 @@ def bind_one(dev_id, driver, force):
def unbind_all(dev_list, force=False):
"""Unbind method, takes a list of device locations"""
+
+ if dev_list[0] == "dpdk":
+ for d in devices.keys():
+ if "Driver_str" in devices[d]:
+ if devices[d]["Driver_str"] in dpdk_drivers:
+ unbind_one(devices[d]["Slot"], force)
+ return
+
dev_list = map(dev_id_from_dev_name, dev_list)
for d in dev_list:
unbind_one(d, force)