if not driver or cur_driver != driver:
DUTSetup.pci_driver_unbind(node, pci_addr)
+ @staticmethod
+ def bind_pci_devices_to_specific_driver(node, driver, *pci_addrs):
+ """Bind PCI devices to input driver on node. Unbind from previous.
+
+ :param node: DUT node.
+ :param driver: Driver to bind to.
+ :param pci_addrs: PCI device addresses.
+ :type node: dict
+ :type driver: str
+ :type pci_addrs: list
+ """
+ for pci_addr in pci_addrs:
+ DUTSetup.pci_driver_unbind(node, pci_addr)
+ DUTSetup.pci_driver_bind(node, pci_addr, driver)
+
@staticmethod
def pci_driver_bind(node, pci_addr, driver):
"""Bind PCI device to driver on node.
| | Run Keyword If | ${nic_vfs}
| | ... | ${dut}.Add OCTEON Dev | @{${dut}_prevf_pci}
| | Run Keyword If | not ${nic_vfs}
-| | ... | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci |
-| | ... | ... | @{${dut}_pf_pci}
+| | ... | Bind PCI Devices To Specific Driver | ${nodes['${dut}']} | vfio-pci
+| | ... | @{${dut}_pf_pci}
| | Run Keyword If | not ${nic_vfs}
| | ... | ${dut}.Add OCTEON Dev | @{${dut}_pf_pci}