netvsp: Support hot remove/add of network pci device#3580
Open
sunilmut wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for surprise hot remove/add of MANA network PCI devices in OpenHCL's HclNetworkVFManagerWorker. Previously, after a surprise PCI hotplug, OpenHCL would keep a stale handle to the device and could not recover. The worker now distinguishes between vPCI-coordinated and uevent-driven (surprise) device state transitions, and avoids reporting an unsolicited binding-state change to the host on surprise events.
Changes:
mana_device_arrived/mana_device_removedand theirNextWorkItemvariants now carry anis_surprise_*flag and skipupdate_vtl2_device_bind_stateon surprise transitions.- Uevent dispatch logic in the run loop matches on
(state, action, exists)and uses a newseen_device_enumeratedatomic flag to correlate vPCIDeviceEnumeratedwith a subsequent uevent add/rescan. HclNetworkVfManagerUeventHandlernow also matches child paths under the device and PCI bus removal paths, and translatesRESCAN=truenotifications into a newUeventAction::Rescan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If network PCI devices get hot removed or added, currently the openhcl networking code will not behave properly, in the sense that it will keep an handle open to the PCI device. And, from there on, OpenHCL cannot recover from that point.
This PR adds support for hot add/remove of network PCI devices using the uevent mechanism, and when:
This allows other components to disconnect VTL2 network devices, service their components and reattach it. The existing flexiov hot restart (FHR) flows doesnt work for all cases because in emulation mode, FHR servicing is not visible to OpenHCL