public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Andrew Bailey <abailey@iol.unh.edu>
To: luca.vizzarro@arm.com, probb@iol.unh.edu
Cc: dmarx@iol.unh.edu, dev@dpdk.org, Andrew Bailey <abailey@iol.unh.edu>
Subject: [PATCH v2 5/5] dts: automate VFIO-PCI modprobe in node setup
Date: Tue, 10 Feb 2026 13:06:45 -0500	[thread overview]
Message-ID: <20260210180645.65880-6-abailey@iol.unh.edu> (raw)
In-Reply-To: <20260210180645.65880-1-abailey@iol.unh.edu>

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.
In addition, if the SUT is expected to use a subset of a few QAT devices,
VFIO-PCI must be loaded in a separate manner. This patch adds this
distinction.

Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
---
 dts/framework/testbed_model/linux_session.py | 24 ++++++++++++++++++++
 dts/framework/testbed_model/os_session.py    |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index a9eb8b693d..c41155e23b 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -224,6 +224,30 @@ def devbind_script_path(self) -> PurePath:
         """
         raise InternalError("Accessed devbind script path before setup.")
 
+    def load_vfio(self, pf_port: Port) -> None:
+        """Overrides :meth:`~os_session.OSSession,load_vfio`."""
+        cmd_result = self.send_command(f"lspci -nn -s {pf_port.pci}")
+        device = re.search(r":([0-9a-fA-F]{4})\]", cmd_result.stdout)
+        if device and device.group(1) in ["37c8", "0435", "19e2"]:
+            self.send_command(
+                "modprobe -r vfio_iommu_type1; modprobe -r vfio_pci",
+                privileged=True,
+            )
+            self.send_command(
+                "modprobe -r vfio_virqfd; modprobe -r vfio",
+                privileged=True,
+            )
+            self.send_command(
+                "modprobe vfio-pci disable_denylist=1 enable_sriov=1", privileged=True
+            )
+            self.send_command(
+                "echo 1 | tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode",
+                privileged=True,
+            )
+        else:
+            self.send_command("modprobe vfio-pci")
+        self.refresh_lshw()
+
     def create_crypto_vfs(self, pf_port: list[Port]) -> None:
         """Overrides :meth:`~os_session.OSSession.create_crypto_vfs`.
 
diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
index 2eeeea6967..4a4fc1f34a 100644
--- a/dts/framework/testbed_model/os_session.py
+++ b/dts/framework/testbed_model/os_session.py
@@ -615,6 +615,10 @@ def configure_port_mtu(self, mtu: int, port: Port) -> None:
             port: Port to set `mtu` on.
         """
 
+    @abstractmethod
+    def load_vfio(self, pf_port: Port) -> None:
+        """Load the vfio module according to the device type of the given port."""
+
     @abstractmethod
     def create_crypto_vfs(self, pf_ports: list[Port]) -> None:
         """Creatues virtual functions for each port in 'pf_ports'.
-- 
2.50.1


  parent reply	other threads:[~2026-02-10 19:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260122214424.322422-1-abailey@iol.unh.edu>
2026-01-22 21:44 ` [PATCH v1 1/5] dts: add find float method to text parser Andrew Bailey
2026-01-23 16:32   ` Dean Marx
2026-01-22 21:44 ` [PATCH v1 2/5] dts: add cryptodev package to DTS Andrew Bailey
2026-01-23 16:36   ` Dean Marx
2026-01-22 21:44 ` [PATCH v1 3/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-01-23 16:46   ` Dean Marx
2026-02-02 15:51     ` Andrew Bailey
2026-01-22 21:44 ` [PATCH v1 4/5] dts: add crypto test decorator Andrew Bailey
2026-01-23 16:54   ` Dean Marx
2026-01-22 21:44 ` [PATCH v1 5/5] dts: automate VFIO-PCI modprobe in node setup Andrew Bailey
2026-01-23 16:57   ` Dean Marx
2026-02-10 18:06 ` [PATCH v2 0/5] *** dts: add cryptodev testing support *** Andrew Bailey
2026-02-10 18:06   ` [PATCH v2 1/5] dts: add find float method to text parser Andrew Bailey
2026-02-10 18:06   ` [PATCH v2 2/5] dts: add cryptodev package to DTS Andrew Bailey
2026-02-10 18:06   ` [PATCH v2 3/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-02-10 18:06   ` [PATCH v2 4/5] dts: add crypto test decorator Andrew Bailey
2026-02-10 18:06   ` Andrew Bailey [this message]
2026-02-10 19:38   ` [PATCH v2 0/5] *** dts: add cryptodev testing support *** Andrew Bailey
2026-02-10 19:34 [PATCH v2 0/5] dts: add cryptodev testing support Andrew Bailey
2026-02-10 19:34 ` [PATCH v2 5/5] dts: automate VFIO-PCI modprobe in node setup Andrew Bailey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260210180645.65880-6-abailey@iol.unh.edu \
    --to=abailey@iol.unh.edu \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=probb@iol.unh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox