vmm_test: MANA VF reset tests - #4393
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 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.
| // 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?; |
There was a problem hiding this comment.
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.
Adding to the VMM Petri integration test suite with GDMA infrastructure and Petri coverage for the MANA VF reset.