Skip to content

vmm_test: MANA VF reset tests - #4393

Open
erfrimod wants to merge 18 commits into
microsoft:mainfrom
erfrimod:erfrimod/vmm-test-vf-reconfig-focus
Open

vmm_test: MANA VF reset tests#4393
erfrimod wants to merge 18 commits into
microsoft:mainfrom
erfrimod:erfrimod/vmm-test-vf-reconfig-focus

Conversation

@erfrimod

@erfrimod erfrimod commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Adding to the VMM Petri integration test suite with GDMA infrastructure and Petri coverage for the MANA VF reset.

  • Adding a gdma device resolver that allows tests to send HWC EQEs for the MANA emulator.
  • Adding Petri control for a paired VTL2 device with subordinate VTL0 device.
  • Adding VPCI OFFER handling needed to run the tests.
  • OpenHCL Linux-direct MANA NIC tests refactored into a separate file.
    • New OpenHCL linux-direct tests for VF Reset (with and without VTL0 revoke)

Copilot AI lite review requested due to automatic review settings September 4, 2026 23:17
@erfrimod
erfrimod requested a review from a team as a code owner September 4, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new VF reset test path has an identified race that can make the integration tests flaky without a bounded wait/retry after asynchronous reconfiguration.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR expands the Petri-based VMM integration test suite to cover MANA NIC behavior in OpenHCL Linux-direct scenarios, including VF reset/reconfiguration, by adding a test-controllable GDMA/MANA device path and the minimal supporting plumbing needed to exercise it end-to-end.

Changes:

  • Introduce a test-controllable GDMA device (gdma_test) that can inject HWC EQEs (e.g., VF reset) into the emulator.
  • Extend Petri OpenVMM configuration to create a paired VTL2 device with a subordinate VTL0 VF for MANA testing.
  • Add/refactor OpenHCL Linux-direct MANA integration tests and add GET-side VPCI device control handling needed by the new tests.
File summaries
File Description
vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_linux_direct/mana_nic.rs New OpenHCL Linux-direct MANA NIC tests, including VF reset coverage.
vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_linux_direct.rs Registers the new mana_nic test module.
vm/devices/net/gdma/src/resolver.rs Refactors vport resolution into a shared helper for production + test resolvers.
vm/devices/net/gdma/src/queues.rs Exposes queue ID offset internally for test injection plumbing.
vm/devices/net/gdma/src/lib.rs Adds test_helpers feature module to support cross-crate test injection.
vm/devices/net/gdma/src/bnic.rs Implements VTL2 filter move/query support needed by VF reconfiguration flows.
vm/devices/net/gdma/Cargo.toml Adds test_helpers feature flag.
vm/devices/net/gdma_test/src/resolver.rs New resolver creating GDMA device + background EQE injection task for tests.
vm/devices/net/gdma_test/src/lib.rs New gdma_test crate entry point.
vm/devices/net/gdma_test/Cargo.toml New crate manifest wiring gdma with test_helpers.
vm/devices/net/gdma_resources/src/lib.rs Adds MeshPayload resource handle + request enum for test-controlled GDMA.
vm/devices/get/guest_emulation_device/src/lib.rs Adds handling for VPCI_DEVICE_CONTROL messages (OFFER/REVOKE/RESET).
petri/src/vm/openvmm/modify.rs Adds paired VTL2/VTL0 NIC config and ManaTestControl request API.
petri/src/vm/openvmm/mod.rs Re-exports ManaTestControl for test use.
openvmm/openvmm_resources/src/lib.rs Registers the new GdmaTestDeviceResolver.
openvmm/openvmm_resources/Cargo.toml Adds gdma_test dependency.
Cargo.toml Adds gdma_test to workspace dependencies.
Cargo.lock Records the new gdma_test package.
Review details
  • Files reviewed: 17/18 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +126 to +129
// Injection only waits for the EQE to be posted.
mana.inject_vf_reset(revoke_vtl0_vf).await?;
validate_mana_nic(&agent, "eth1").await?;
validate_vtl0_mana_vf(&agent).await?;

@erfrimod erfrimod Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree that vf reset is racy and validation should wait, but I don't have a good signal to wait for. Ideally, I will add a counter for vf_reset and then the test can poll inspect for the increment.

As-is, the test is still useful as a smoke test. I don't anticipate flakey test failures, but rather that the test may pass before the code is finished reconfiguring.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

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.

2 participants