fix(infra): Octeon binding 55/42455/2
authorPeter Mikus <[email protected]>
Thu, 6 Mar 2025 09:58:42 +0000 (10:58 +0100)
committerPeter Mikus <[email protected]>
Thu, 6 Mar 2025 10:32:09 +0000 (11:32 +0100)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: I0e8ee3de3fbac53aad6a530804c67b0114b89b50

resources/libraries/python/DUTSetup.py
resources/libraries/robot/shared/interfaces.robot

index bc8af37..8c240d9 100644 (file)
@@ -380,6 +380,21 @@ class DUTSetup:
             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.
index 3938115..929ff16 100644 (file)
 | | 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}