DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH] usertools: add option to unbind all devices
Date: Thu,  4 May 2017 15:10:50 +0100	[thread overview]
Message-ID: <20170504141050.64045-1-ferruh.yigit@intel.com> (raw)

-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>
---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 2d99e9d..1a51c26 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -517,6 +517,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)
-- 
2.9.3

             reply	other threads:[~2017-05-04 14:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 14:10 Ferruh Yigit [this message]
2017-07-05 22:54 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170504141050.64045-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).