diff options
author | Juraj Linkeš <juraj.linkes@pantheon.tech> | 2021-06-24 16:47:55 +0200 |
---|---|---|
committer | Juraj Linkeš <juraj.linkes@pantheon.tech> | 2021-08-02 09:11:49 +0200 |
commit | 7d849ba64e10b8a7678845ee1dcc091e125dd124 (patch) | |
tree | 30cfcf8397fd5c058950c359e73e2c83c3556354 /resources/libraries/python/InterfaceUtil.py | |
parent | 324f01417f17a5347c102179f3d2277a77b116ce (diff) |
FIX: init_interface driver and sr-iov
Add checks for not unbinding a driver that is not bound and not
trying to remove VFs from interfaces not supporting SR-IOV.
Change-Id: Iae7ce37aabeadbb541fe9eac8b83b4ee18d028e6
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r-- | resources/libraries/python/InterfaceUtil.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index af34c64501..4cd7cf10b6 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -1828,8 +1828,9 @@ class InterfaceUtil: # PCI device must be re-bound to kernel driver before creating VFs. DUTSetup.verify_kernel_module(node, kernel_driver, force_load=True) # Stop VPP to prevent deadlock. - # Unbind from current driver. - DUTSetup.pci_driver_unbind(node, pf_pci_addr) + # Unbind from current driver if bound. + if current_driver: + DUTSetup.pci_driver_unbind(node, pf_pci_addr) # Bind to kernel driver. DUTSetup.pci_driver_bind(node, pf_pci_addr, kernel_driver) |