From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 149C7106B for ; Wed, 4 Mar 2015 03:55:45 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 03 Mar 2015 18:55:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,685,1418112000"; d="scan'208";a="686522213" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 03 Mar 2015 18:55:43 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t242tfWP005891; Wed, 4 Mar 2015 10:55:41 +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 t242tbqu020781; Wed, 4 Mar 2015 10:55:39 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t242tbUx020777; Wed, 4 Mar 2015 10:55:37 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Wed, 4 Mar 2015 10:55:35 +0800 Message-Id: <1425437735-20673-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1424926669-14202-1-git-send-email-changchun.ouyang@intel.com> References: <1424926669-14202-1-git-send-email-changchun.ouyang@intel.com> Subject: [dpdk-dev] [PATCH v2] 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: Wed, 04 Mar 2015 02:55:46 -0000 The dpdk_nic_bind script will not allow ports to be bound or unbound if none of the kernel modules supported by DPDK is loaded. This patch relaxes this restriction by checking if a DPDK module is actually requested. The example below illustrates this problem: In virtio test, on the 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 script 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 --- Changes in v2: -- Update the description. 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