Skip to content

mana_driver: return None from save() when VF reconfiguration is pending#3849

Open
erfrimod wants to merge 2 commits into
microsoft:mainfrom
erfrimod:erfrimod/save-vf-pending
Open

mana_driver: return None from save() when VF reconfiguration is pending#3849
erfrimod wants to merge 2 commits into
microsoft:mainfrom
erfrimod:erfrimod/save-vf-pending

Conversation

@erfrimod

@erfrimod erfrimod commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

When the GDMA driver receives EQE 135 (VF reconfiguration request), it sets reset_request_pending. Calling save() in this state will return an Err(...), which causes the netvsp save path to treat it as a genuine driver failure and schedule an FLR.

  • GdmaDriver::save() returns Ok(None) when VF reconfiguration is pending.
  • ManaDevice::save() returns Ok(None) when Ok(None) is returned by GdmaDriver::save().
  • The emuplat netvsp save path recognizes Ok(None) via a new VfManagerSaveResult::NoSavedState variant and returns no saved state without triggering FLR.
    • On restore, the device will simply reinitialize from scratch.
  • New unit test test_gdma_save_vf_reset_pending verifies that save() returns Ok(None) after EQE 135 is fired. The existing test_gdma_save_restore test is updated to unwrap the Option.

@erfrimod erfrimod requested a review from a team as a code owner July 1, 2026 21:09
Copilot AI review requested due to automatic review settings July 1, 2026 21:09
@erfrimod erfrimod changed the title ana_driver: return None from save() when VF reconfiguration is pending mana_driver: return None from save() when VF reconfiguration is pending Jul 1, 2026

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.

Pull request overview

This PR adjusts the MANA/GDMA save path to treat “VF reconfiguration pending” (EQE 135) as an expected “no saved state” outcome instead of an error, preventing the netvsp servicing flow from scheduling an FLR and allowing restore to reinitialize the device from scratch.

Changes:

  • Change GdmaDriver::save() to return Ok(None) when reset_request_pending is set.
  • Propagate the optional saved-state behavior through ManaDevice::save() and the underhill netvsp VF manager via a new VfManagerSaveResult::NoSavedState variant.
  • Add a unit test to verify save() returns Ok(None) after EQE 135.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
vm/devices/net/mana_driver/src/gdma_driver.rs Return Ok(None) from save() when VF reset/reconfiguration is pending instead of erroring.
vm/devices/net/mana_driver/src/mana.rs Propagate optional GDMA saved state through ManaDevice::save() and improve error logging.
openhcl/underhill_core/src/emuplat/netvsp.rs Recognize Ok(None) via VfManagerSaveResult::NoSavedState to avoid triggering FLR and return no saved state.
vm/devices/net/mana_driver/src/tests.rs Update existing save/restore test for Option and add new test covering the reset-pending save behavior.

Comment thread vm/devices/net/mana_driver/src/mana.rs Outdated
@erfrimod erfrimod force-pushed the erfrimod/save-vf-pending branch from 0e3707d to f19d26a Compare July 1, 2026 21:48
@github-actions

github-actions Bot commented Jul 1, 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