summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOuyang Changchun <changchun.ouyang@intel.com>2015-03-04 10:55:35 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-03-05 21:33:53 +0100
commit92ff8cf229b955e92a60907579c4b08bf818089f (patch)
tree4f2cef2d6e21eb9cb69c1ce81a3dcbc4b3c3bb8d /tools
parentd8b8517893910a1136abbe761b44583b00596d5d (diff)
downloaddpdk-92ff8cf229b955e92a60907579c4b08bf818089f.zip
dpdk-92ff8cf229b955e92a60907579c4b08bf818089f.tar.gz
dpdk-92ff8cf229b955e92a60907579c4b08bf818089f.tar.xz
tools: fix binding to unsupported driver
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 <changchun.ouyang@intel.com> Tested-by: Qian Xu <qian.q.xu@intel.com> Acked-by: Michael Qiu <michael.qiu@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dpdk_nic_bind.py7
1 files 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"]]