diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2017-03-07 17:34:05 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2017-03-07 17:34:05 +0200 |
commit | 183f492cd3bba890291bd7cfc79624dbc1fb2b01 (patch) | |
tree | ce49b03c301551b8534085ce3d1d6beaeb17fa97 | |
parent | db7dc2041ff3d2af30a91b92060fcc4631b6449e (diff) |
dpdk_setup_ports: fix vfio-pci always raising
Change-Id: I523fb4e7df6c9bfb16984a0875a7085e505a6dd3
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rwxr-xr-x | scripts/dpdk_setup_ports.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py index de73fea1..3ec77fbf 100755 --- a/scripts/dpdk_setup_ports.py +++ b/scripts/dpdk_setup_ports.py @@ -505,15 +505,15 @@ Other network devices raise VFIOBindErr('Could not find file with Kernel boot parameters: %s' % krnl_params_file) with open(krnl_params_file) as f: krnl_params = f.read() - if 'iommu=' in krnl_params: - if 'vfio_pci' not in dpdk_nic_bind.get_loaded_modules(): - ret = os.system('modprobe vfio_pci') - if ret: - raise VFIOBindErr('Could not load vfio_pci') - ret = self.do_bind_all('vfio-pci', to_bind_list) + if 'iommu=' not in krnl_params: + raise VFIOBindErr('vfio-pci is not an option here') + if 'vfio_pci' not in dpdk_nic_bind.get_loaded_modules(): + ret = os.system('modprobe vfio_pci') if ret: - raise VFIOBindErr('Binding to vfio_pci failed') - raise VFIOBindErr('vfio-pci is not an option here') + raise VFIOBindErr('Could not load vfio_pci') + ret = self.do_bind_all('vfio-pci', to_bind_list) + if ret: + raise VFIOBindErr('Binding to vfio_pci failed') def pci_name_to_full_name (self,pci_name): |