From: Andrew Bailey <abailey@iol.unh.edu>
To: luca.vizzarro@arm.com, probb@iol.unh.edu, dev@dpdk.org
Cc: dmarx@iol.unh.edu, Andrew Bailey <abailey@iol.unh.edu>
Subject: [PATCH v2 5/5] dts: automate VFIO-PCI modprobe in node setup
Date: Tue, 10 Feb 2026 14:34:48 -0500 [thread overview]
Message-ID: <20260210193448.69423-6-abailey@iol.unh.edu> (raw)
In-Reply-To: <20260210193448.69423-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
next prev parent reply other threads:[~2026-02-10 19:35 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 19:34 [PATCH v2 0/5] dts: add cryptodev testing support Andrew Bailey
2026-02-10 19:34 ` [PATCH v2 1/5] dts: add find float method to text parser Andrew Bailey
2026-02-10 19:34 ` [PATCH v2 2/5] dts: add cryptodev package to DTS Andrew Bailey
2026-02-10 19:34 ` [PATCH v2 3/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-02-10 19:34 ` [PATCH v2 4/5] dts: add crypto test decorator Andrew Bailey
2026-02-10 19:34 ` Andrew Bailey [this message]
2026-02-13 19:35 ` [PATCH v3 0/5] dts: add cryptodev testing support Andrew Bailey
2026-02-13 19:35 ` [PATCH v3 1/5] dts: add find float method to text parser Andrew Bailey
2026-02-25 21:05 ` Patrick Robb
2026-02-13 19:35 ` [PATCH v3 2/5] dts: add cryptodev package to DTS Andrew Bailey
2026-02-25 21:06 ` Patrick Robb
2026-02-26 19:13 ` Andrew Bailey
2026-02-27 16:15 ` Patrick Robb
2026-02-13 19:35 ` [PATCH v3 3/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-02-27 18:24 ` Patrick Robb
2026-02-27 19:43 ` Andrew Bailey
2026-02-13 19:35 ` [PATCH v3 4/5] dts: add crypto test decorator Andrew Bailey
2026-02-27 18:28 ` Patrick Robb
2026-02-27 19:18 ` Andrew Bailey
2026-02-13 19:35 ` [PATCH v3 5/5] dts: automate VFIO-PCI modprobe in node setup Andrew Bailey
2026-02-27 18:33 ` Patrick Robb
2026-03-02 18:54 ` [PATCH v4 0/5] dts: add cryptodev testing support Andrew Bailey
2026-03-02 18:54 ` [PATCH v4 1/5] dts: add find float method to text parser Andrew Bailey
2026-03-02 18:54 ` [PATCH v4 2/5] dts: automate VFIO-PCI modprobe in node setup Andrew Bailey
2026-03-02 18:54 ` [PATCH v4 3/5] dts: add cryptodev package to DTS Andrew Bailey
2026-03-02 18:54 ` [PATCH v4 4/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-03-05 19:26 ` Patrick Robb
2026-03-05 20:20 ` Patrick Robb
2026-03-02 18:54 ` [PATCH v4 5/5] dts: add crypto test decorator Andrew Bailey
2026-03-06 16:40 ` [PATCH v5 0/5] dts: add cryptodev testing support Andrew Bailey
2026-03-06 16:40 ` [PATCH v5 1/5] dts: add find float method to text parser Andrew Bailey
2026-03-06 16:40 ` [PATCH v5 2/5] dts: automate VFIO-PCI modprobe in node setup Andrew Bailey
2026-03-06 16:40 ` [PATCH v5 3/5] dts: add cryptodev package to DTS Andrew Bailey
2026-03-09 1:26 ` Patrick Robb
2026-03-06 16:40 ` [PATCH v5 4/5] dts: add cryptodev throughput test suite Andrew Bailey
2026-03-06 16:40 ` [PATCH v5 5/5] dts: add crypto test decorator Andrew Bailey
2026-03-12 18:08 ` Thomas Monjalon
2026-03-12 18:48 ` Andrew Bailey
2026-03-12 18:55 ` Thomas Monjalon
2026-03-12 19:54 ` Patrick Robb
2026-03-12 20:29 ` Thomas Monjalon
[not found] <20260122214424.322422-1-abailey@iol.unh.edu>
2026-02-10 18:06 ` [PATCH v2 0/5] *** dts: add cryptodev testing support *** Andrew Bailey
2026-02-10 18:06 ` [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=20260210193448.69423-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