Skip to content

passthrough: Add PCI BDF list support for device pool#4317

Merged
LiliDeng merged 1 commit intomainfrom
vyadav_nic_passth
Mar 5, 2026
Merged

passthrough: Add PCI BDF list support for device pool#4317
LiliDeng merged 1 commit intomainfrom
vyadav_nic_passth

Conversation

@vyadavmsft
Copy link
Collaborator

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_bdf lists.
  • 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_max to 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

@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passth branch 2 times, most recently from 72801de to 9f63480 Compare March 5, 2026 03:23
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.
@LiliDeng LiliDeng merged commit 3f8bc01 into main Mar 5, 2026
58 checks passed
@LiliDeng LiliDeng deleted the vyadav_nic_passth branch March 5, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants