From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 15B8E7CC7 for ; Thu, 4 May 2017 16:10:56 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2017 07:10:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,287,1491289200"; d="scan'208";a="95535966" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by orsmga005.jf.intel.com with ESMTP; 04 May 2017 07:10:54 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit Date: Thu, 4 May 2017 15:10:50 +0100 Message-Id: <20170504141050.64045-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.9.3 Subject: [dpdk-dev] [PATCH] usertools: add option to unbind all devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 14:10:57 -0000 -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 ============================================ .... Signed-off-by: Ferruh Yigit --- 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