All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] doc/test-functional: Document PCIe controller passthrough
@ 2026-09-15 21:44 Luiz Augusto von Dentz
  2026-09-15 22:49 ` [BlueZ,v1] " bluez.test.bot
  2026-09-16 18:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-09-15 21:44 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

The tests needing a real controller can now use a PCIe one with --pcie
and --force-pcie, in the same way --usb and --force-usb use an USB one.

Unlike an USB controller, which only needs its device node to be
readable, a PCIe controller is bound to vfio-pci while a VM host uses
it, so the tests have to be run as root and the controller has to be
alone in its IOMMU group.

The model wrote the option handling in pytest-bluezenv and this section;
it was reviewed and tested by the author.

Assisted-by: Claude:claude-opus-5
---
 doc/test-functional.rst | 51 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 5 deletions(-)

diff --git a/doc/test-functional.rst b/doc/test-functional.rst
index 4a784e7850a3..3ffcbf6dec5c 100644
--- a/doc/test-functional.rst
+++ b/doc/test-functional.rst
@@ -107,6 +107,20 @@ The following additional options apply:
 ``--force-usb``
         Force tests to use USB controllers instead of `btvirt`.
 
+``--pcie=hci0,hci1``
+        PCIe controllers to use in tests that require use of
+	real controllers.
+
+	If not provided, value from `FUNCTIONAL_TESTING_CONTROLLERS`
+	environment variable is used. If none, all PCIe controllers
+	are considered.
+
+	Passing a PCIe controller through binds it to vfio-pci for
+	the time a VM host uses it, which requires running as root.
+
+``--force-pcie``
+        Force tests to use PCIe controllers instead of `btvirt`.
+
 ``--bluez-build-dir=<path>``
         Path to build directory where to search for BlueZ
         executables.
@@ -139,7 +153,7 @@ The following additional options apply:
         Git branch to build from.
 
 
-Tests that require kernel image or USB controllers are skipped if none
+Tests that require kernel image or real controllers are skipped if none
 are available. Normally, tests use `btvirt`.
 
 VM instances share a directory ``/run/shared`` with host machine,
@@ -224,10 +238,10 @@ socket, also bridging the air interface between them::
 
 See **test-runner(1)** for how the socket is attached to the VM.
 
-With ``--usb`` the ``btvirt`` process is not started; each VM host gets a
-real USB controller passed through instead, and the VMs talk over the
-actual radio.  Tests still prefer ``btvirt`` unless ``--force-usb`` is
-given.
+With ``--usb`` or ``--pcie`` the ``btvirt`` process is not started; each
+VM host gets a real USB or PCIe controller passed through instead, and the
+VMs talk over the actual radio.  Tests still prefer ``btvirt`` unless
+``--force-usb`` or ``--force-pcie`` is given.
 
 Writing test code that runs in the VM, and the available VM-side
 facilities, are documented by `pytest-bluezenv
@@ -306,6 +320,17 @@ USB
 
 Some tests may require a hardware controller instead of the virtual `btvirt` one.
 
+PCIe
+----
+
+A PCIe controller may be used instead of a USB one. It is bound to
+vfio-pci for the time a VM host uses it, and bound back to its own
+driver afterwards, which requires running the tests as root.
+
+The IOMMU has to be enabled on the host, and the controller has to be
+alone in its IOMMU group. See **test-runner(1)** for the kernel config
+the passed through controller needs.
+
 EXAMPLES
 ========
 
@@ -422,6 +447,22 @@ possible.  To force all tests use the USB controllers:
 
 	$ test/test-functional --usb=hci0,hci1 --force-usb
 
+Redirect PCIe devices
+---------------------
+
+.. code-block::
+
+	$ sudo test/test-functional --pcie=hci0,hci1
+
+Unlike USB controllers, this requires running as root, as the controller
+is bound to vfio-pci while a VM host uses it.
+
+To force all tests use the PCIe controllers:
+
+.. code-block::
+
+	$ sudo test/test-functional --pcie=hci0,hci1 --force-pcie
+
 Run tests in parallel
 ---------------------
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-16 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 21:44 [PATCH BlueZ v1] doc/test-functional: Document PCIe controller passthrough Luiz Augusto von Dentz
2026-09-15 22:49 ` [BlueZ,v1] " bluez.test.bot
2026-09-16 18:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.