[v2] dts: automate VFIO-PCI modprobe

Message ID 20251126141650.367633-1-abailey@iol.unh.edu (mailing list archive)
State New
Delegated to: Luca Vizzarro
Headers
Series [v2] dts: automate VFIO-PCI modprobe |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-dts-check-format-testing success Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS

Commit Message

Andrew Bailey Nov. 26, 2025, 2:16 p.m. UTC
Currently, users must modprobe vfio-pci before running DTS when using a
non-mellanox NIC. This patch automates the process on test run start up.

Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
---
 dts/framework/test_run.py | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/dts/framework/test_run.py b/dts/framework/test_run.py
index ff0a12c9ce..9d7b6271c7 100644
--- a/dts/framework/test_run.py
+++ b/dts/framework/test_run.py
@@ -106,6 +106,7 @@ 
 from types import MethodType
 from typing import ClassVar, Protocol, Union
 
+from api.capabilities import LinkTopology
 from framework.config.test_run import TestRunConfiguration
 from framework.context import Context, init_ctx
 from framework.exception import InternalError, SkippedTestException, TestCaseVerifyError
@@ -347,6 +348,13 @@  def next(self) -> State | None:
         test_run.ctx.dpdk.setup()
         test_run.ctx.topology.setup()
 
+        if (
+            test_run.ctx.topology.type != LinkTopology.NO_LINK
+            and test_run.ctx.sut_node.ports[0].config.os_driver_for_dpdk == "vfio-pci"
+        ):
+            test_run.ctx.sut_node.main_session.send_command("modprobe vfio")
+            test_run.ctx.sut_node.main_session.send_command("modprobe vfio-pci")
+
         if test_run.config.use_virtual_functions:
             test_run.ctx.topology.instantiate_vf_ports()