netvsp: tune VF and link delays per guest OS version#3509
Draft
erfrimod wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes netvsp guest-aware when applying VF offer and link-change delays, avoiding Linux-specific workarounds for guests that do not need them while preserving conservative behavior when the guest OS is unknown.
Changes:
- Adds helper logic to derive VF and link delay durations from the Hyper-V guest OS ID.
- Stores the computed delays in channel/coordinator state and exposes them via inspect.
- Adds unit/async tests for guest OS delay selection and inspect output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
vm/devices/net/netvsp/src/lib.rs |
Adds guest OS-aware delay helpers, wires computed delays into netvsp coordinator/channel behavior, and exposes delay values through inspect. |
vm/devices/net/netvsp/src/test.rs |
Adds guest OS ID construction helpers plus tests for delay policy and inspect reporting. |
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.
The 1s
VF_DEVICE_DELAYand 5sLINK_DELAY_DURATIONexist to work aroundLinux
hv_netvsclimitations. They are unconditionally applied today,penalizing Windows, FreeBSD, and modern Linux guests that don't need them.
This PR introduces
vf_device_delay()andlink_delay_duration()helpersthat consult the guest OS ID and return
Duration::ZEROfor guests that do not require the respective delays. The VF delay is gated
on Linux < 6.7 (fixed by upstream commit d30fb712); the link delay still
applies to all Linux versions.
NOTE: The link delay duration is used to coalesce link state (up/down) notifications over a time frame. Even if it is technically correct to report each update, there could be beneficial side effects to smoothing them out for the Guest. I won't be able to know how each Guest / Application will behave if they start seeing a storm of link flapping that would previously be reported as one notification every 5 seconds.
Testing: TBD