From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4DD413790 for ; Thu, 26 Feb 2015 05:57:58 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 25 Feb 2015 20:53:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,650,1418112000"; d="scan'208";a="533018900" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 25 Feb 2015 20:48:46 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t1Q4vr9F031160; Thu, 26 Feb 2015 12:57:53 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1Q4voYb014235; Thu, 26 Feb 2015 12:57:53 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1Q4votC014231; Thu, 26 Feb 2015 12:57:50 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Thu, 26 Feb 2015 12:57:49 +0800 Message-Id: <1424926669-14202-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH] tools/dpdk_nic_bind: Fix can't bind virtio-pci issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2015 04:57:58 -0000 In virtio test, on guest 1. Bind virtio port to igb_uio driver; 2. Remove igb_uio module; 3. Bind virtio port to virtio-pci driver, it fails and reports: "Error - no supported modules are loaded" The tool should check the to-be-bound driver flag, if it is dpdk driver(igb_uio, vfio etc), and the corresponding module is not loaded, then exit, otherwise, just report a warning, and continue to bind the non-dpdk driver(like virtio-pci) to dev. Signed-off-by: Changchun Ouyang --- tools/dpdk_nic_bind.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py index 2483056..8523f82 100755 --- a/tools/dpdk_nic_bind.py +++ b/tools/dpdk_nic_bind.py @@ -175,8 +175,11 @@ def check_modules(): # check if we have at least one loaded module if True not in [mod["Found"] for mod in mods] and b_flag is not None: - print "Error - no supported modules are loaded" - sys.exit(1) + if b_flag in dpdk_drivers: + print "Error - no supported modules(DPDK driver) are loaded" + sys.exit(1) + else: + print "Warning - no supported modules(DPDK driver) are loaded" # change DPDK driver list to only contain drivers that are loaded dpdk_drivers = [mod["Name"] for mod in mods if mod["Found"]] -- 1.8.4.2