netvsp & mana_driver - Improve failure identification & improve cleanup#3146
netvsp & mana_driver - Improve failure identification & improve cleanup#3146ben-zen merged 7 commits intomicrosoft:mainfrom
Conversation
b45d0bc to
55bffa1
Compare
There was a problem hiding this comment.
Pull request overview
Improves diagnosability of rare shutdown/save failures in the MANA VF driver by adding explicit panic messages when Arc::into_inner() fails, and ensures netvsp drops packet-capture controls during endpoint teardown to help release retained vport references.
Changes:
- Replace
unwrap()withexpect()forArc::into_inner(self.inner)inManaDevice::{save,shutdown}to provide clearer failure identification. - Clear
pkt_capture_controlsafter disconnecting endpoints to force-drop any retained packet capture controls during teardown.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vm/devices/net/mana_driver/src/mana.rs | Adds clearer expect() messages when unwrapping the device inner Arc during save/shutdown. |
| openhcl/underhill_core/src/emuplat/netvsp.rs | Ensures packet capture controls are dropped after endpoint disconnect to help release retained vport references. |
|
We discussed in the team that it's odd that If that's seen as worthwhile, I plan to bring it as a separate patch as this is a targeted set of changes that are worthwhile in of themselves. |
55bffa1 to
df247ec
Compare
098faaa to
7cfdf6e
Compare
24465a9 to
1d99489
Compare
1d99489 to
e625841
Compare
Arc::<T>::into_inner()returnsSome(T)orNone, and a call tounwrap()that returned result will panic with no clear error message; in cases where all clones of anArcwill eventually haveinto_inner()called on them, the resource will eventually be de-reference-counted and ultimately released, but the clones ofManaDevice::innerare stored inVports which need to be cleaned up before one of the expected terminal states of theManaDeviceis reached.This change replaces
.unwrap()with.expect()on both calls to extractManaDevice::innerfrom its Arc, and extends the endpoint shutdown logic with an extra cleanup step to force the release of netvsp's retainedVportinstance, as well as to ensure that the senders for those now-disconnected endpoints are shut down afterwards.