passthrough: Add PCI BDF list support for device pool#4317
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends device-passthrough device pool configuration to support explicit PCI BDF lists (in addition to vendor/device IDs) and updates passthrough functional/performance tests to work with BDF-based pools and more robust guest NIC bring-up.
Changes:
- Add schema + device-pool parsing support for device pools defined by
pci_bdflists. - Implement libvirt device-pool creation from explicit PCI addresses (and refactor pooling logic).
- Refactor network passthrough performance tests to reboot only guests, improve NIC selection, wait for carrier, and add DHCP/link diagnostics; add
skip_server_task_maxto avoid rebooting baremetal hosts.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lisa/sut_orchestrator/util/schema.py | Introduces PciAddressIdentifier and updates HostDevicePoolSchema.devices to accept vendor/device IDs or a BDF list. |
| lisa/sut_orchestrator/util/device_pool.py | Updates base device-pool configuration flow to dispatch between vendor/device vs BDF-based pool creation. |
| lisa/sut_orchestrator/libvirt/schema.py | Adds equality logic to DeviceAddressSchema (used for de-duping devices). |
| lisa/sut_orchestrator/libvirt/libvirt_device_pool.py | Implements BDF-based pool creation and factors common pool-building logic into _create_pool. |
| lisa/microsoft/testsuites/performance/networkperf_passthrough.py | Refactors guest NIC selection + DHCP flow with link/carrier waiting and diagnostics; avoids rebooting baremetal host. |
| lisa/microsoft/testsuites/performance/common.py | Adds skip_server_task_max option to avoid server-side TasksMax reboot for ntttcp setup. |
| lisa/microsoft/testsuites/device_passthrough/functional_tests.py | Updates functional passthrough validation to resolve vendor/device IDs from host sysfs when pools are BDF-based. |
Key Test Cases:
verify_device_passthrough_on_guest|perf_tcp_ntttcp_passthrough_host_guest|perf_tcp_iperf_passthrough_two_guest
Impacted LISA Features:
NetworkInterface, Gpu
Tested Azure Marketplace Images:
- canonical 0001-com-ubuntu-server-jammy 22_04-lts latest
lisa/microsoft/testsuites/performance/networkperf_passthrough.py
Outdated
Show resolved
Hide resolved
72801de to
9f63480
Compare
Previously, device pools could only be configured by vendor/device ID, which may pick unintended devices when multiple similar NICs are present. This change allows runbooks to specify exact PCI BDF addresses instead, giving full control over which device gets passed through to the guest. The functional test is updated to handle BDF-only pool configs by reading vendor/device IDs directly from host sysfs at runtime, which remains reliable even after the driver is unbound for VFIO passthrough. The network passthrough perf tests are refactored to robustly set up the guest NIC: it now waits for link carrier before attempting DHCP, pauses competing DHCP managers during the lease, and raises a clear diagnostic on failure. A skip_server_task_max flag prevents rebooting the baremetal host (which would lose its NIC DHCP state) during ntttcp setup.
9f63480 to
fe9e7b8
Compare
LiliDeng
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, device pools could only be configured by vendor/device ID, which may pick unintended devices when multiple similar NICs are present. This change allows runbooks to specify exact PCI BDF addresses instead, giving full control over which device gets passed through to the guest.
The functional test is updated to handle BDF-only pool configs by reading vendor/device IDs directly from host sysfs at runtime, which remains reliable even after the driver is unbound for passthrough.
The network passthrough perf tests are refactored to robustly set up the guest NIC: it now waits for link carrier before attempting DHCP, pauses competing DHCP managers during the lease, and raises a clear diagnostic on failure. A skip_server_task_max flag prevents rebooting the baremetal host (which would lose its NIC DHCP state) during ntttcp setup.