Skip to content

Add device passthrough tests for Cloud Hypervisor platform#4250

Merged
LiliDeng merged 3 commits intomainfrom
vyadav_nic_passthrough
Feb 4, 2026
Merged

Add device passthrough tests for Cloud Hypervisor platform#4250
LiliDeng merged 3 commits intomainfrom
vyadav_nic_passthrough

Conversation

@vyadavmsft
Copy link
Collaborator

This PR adds comprehensive device passthrough testing support for the Cloud Hypervisor platform.

Changes included:

  1. Device Passthrough Functional Tests

    • Add test case to verify passthrough devices are visible to guest in Cloud Hypervisor
    • Validates device detection and basic functionality
  2. NIC Passthrough Performance Tests

    • Add network performance tests for NIC passthrough scenarios
    • Support for ntttcp, iperf3, and netperf benchmarks
    • Cover both host-guest and guest-guest scenarios
    • Enable interface-specific testing for passthrough devices
  3. Tool Enhancements

    • Add interface_ip parameter to netperf.run_as_server() and netperf.run_as_client_async()
    • Add interface_ip parameter to iperf3.run_as_server_async()
    • Enables binding network tools to specific interfaces for accurate passthrough testing
    • Maintains backward compatibility with optional parameters

Signed-off-by: Smit Gardhariya sgardhariya@microsoft.com
Co-authored-by: Vivek Yadav vyadav@microsoft.com

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

Adds Cloud Hypervisor–specific device passthrough validation and NIC passthrough performance testing, plus small network tool enhancements to support interface-bound benchmarking.

Changes:

  • Extend netperf and iperf3 tool wrappers with optional interface/IP binding parameters.
  • Add a new Cloud Hypervisor NIC passthrough performance test suite covering iperf3/netperf/ntttcp scenarios.
  • Add a functional test suite to validate passthrough devices are visible inside the guest.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lisa/tools/netperf.py Adds optional local interface IP binding support for netserver/netperf client.
lisa/tools/iperf3.py Adds optional server bind address support (-B) for interface-specific testing.
lisa/microsoft/testsuites/performance/networkperf_passthrough.py Introduces new NIC passthrough performance suite for Cloud Hypervisor (host-guest and guest-guest).
lisa/microsoft/testsuites/performance/common.py Enhances perf helpers to optionally bind to internal addresses for interface-specific runs.
lisa/microsoft/testsuites/device_passthrough/functional_tests.py Adds functional validation that passthrough devices appear in-guest via lspci.
lisa/microsoft/testsuites/device_passthrough/init.py New package init for the passthrough functional suite.
**Key Test Cases:**
verify_device_passthrough_on_guest|perf_tcp_iperf_passthrough_host_guest|perf_tcp_single_pps_passthrough_host_guest|perf_tcp_iperf_passthrough_two_guest

**Impacted LISA Features:**
NetworkInterface

**Tested Azure Marketplace Images:**
- canonical 0001-com-ubuntu-server-jammy 22_04-lts latest

@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch 5 times, most recently from baf8803 to 9b52fa0 Compare January 23, 2026 22:12
@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch from 9b52fa0 to 8063de9 Compare January 26, 2026 18:14
@vyadavmsft vyadavmsft requested a review from LiliDeng January 26, 2026 18:15
@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch 2 times, most recently from 09b7199 to 8063de9 Compare January 30, 2026 00:56
@vyadavmsft vyadavmsft requested a review from LiliDeng January 30, 2026 02:58
@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch 2 times, most recently from f3a8325 to bee6d40 Compare January 30, 2026 06:41
@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch from bee6d40 to 940aad7 Compare February 3, 2026 23:14
@vyadavmsft vyadavmsft requested a review from LiliDeng February 3, 2026 23:40
smit-gardhariya and others added 3 commits February 3, 2026 18:01
Add test case to verify if passthrough-devices
are visible to guest for CH platform

Signed-off-by: Smit Gardhariya <sgardhariya@microsoft.com>
Add testcases for nttcp/iperf3/netperf for
NIC device passthrough cases for host-guest
and guest-guest scenarios.

Signed-off-by: Smit Gardhariya <sgardhariya@microsoft.com>
- Add missing __init__.py for device_passthrough package
- Fix unsafe pool.devices[0] access with validation
- Fix class name typo: NetworkPerformace -> NetworkPerformance
- Add validation for device_addr to prevent None usage
- Fix logic bug: validate only the node parameter, not all node spaces
- Remove unused parameters (log, log_path, variables) from functional test
- Update descriptions: replace 'sriov' with 'passthrough' for accuracy
- Improve error messages with more context
- Add timeout documentation comments
- Clarify server_ip vs interface_ip usage in common.py
- Add pool_type validation before dictionary access
- Move device_passthrough tests to correct location for test discovery

1. Identifies interface by PCI address first (before dhclient)
2. Brings interface UP with 'ip link set up'
3. Waits for carrier detection (30s timeout)
4. Then runs dhclient to get IP address

This ensures the physical link is established before DHCP configuration.
@vyadavmsft vyadavmsft force-pushed the vyadav_nic_passthrough branch from 940aad7 to 07862dd Compare February 4, 2026 02:01
@LiliDeng LiliDeng merged commit 54a66fd into main Feb 4, 2026
58 checks passed
@LiliDeng LiliDeng deleted the vyadav_nic_passthrough branch February 4, 2026 07:28

client_node = cast(RemoteNode, environment.nodes[0])
client, client_nic_name = self._configure_passthrough_nic_for_node(client_node)
server_node = cast(RemoteNode, environment.nodes[1])
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot for any test case in this file which has TestCaseMetadata, if it uses _configure_passthrough_nic_for_node, please set supported_platform_type=[CLOUD_HYPERVISOR], in case node_requirement

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