[AI Generated] BugFix: compute ringbuffer tolerance from PAGE_SIZE#4364
Merged
[AI Generated] BugFix: compute ringbuffer tolerance from PAGE_SIZE#4364
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the NetworkSettings.verify_ringbuffer_settings_change test to account for netvsc ringbuffer section rounding behavior that depends on the guest PAGE_SIZE, avoiding false failures on ARM64/64KiB-page systems.
Changes:
- Compute RX/TX section-count tolerance dynamically using the guest page size (
getconf PAGE_SIZE) and per-section sizes. - Fix TX assertion bounds to use
expected_tx(instead of the priorexpected_rxtypo). - Minor comment correction (
PAGE_SIZEcasing).
The netvsc driver rounds buffer sizes up to PAGE_SIZE, causing the actual RX/TX section count to differ from the requested value. On systems with 64 KiB pages (common on ARM64), the delta can be up to ceil(65536/1728) = 38 for RX and ceil(65536/6144) = 11 for TX, which exceeds the previous hard-coded tolerance of 5. Compute the tolerance dynamically: ceil(PAGE_SIZE / section_size). Also fix a copy-paste typo in the TX assertion upper bound that incorrectly used expected_rx instead of expected_tx.
bd67569 to
9040894
Compare
Contributor
…es throughout ring buffer verification (#4366)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
lisa/microsoft/testsuites/network/networksettings.py:157
- The
2MiB adjustment used fortxbufferis a test-behavior magic number but isn't explained. Please add an inline comment (or extract a named constant) documenting why ±2 MiB is chosen and what it is intended to validate.
if original_rxbuffer - 2 > 0
else (original_rxbuffer + 2)
LiliDeng
approved these changes
Mar 22, 2026
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.
Summary
The netvsc driver rounds buffer sizes up to
PAGE_SIZE, causing the actual RX/TX section count to differ from the requested value. On ARM64 systems with 64 KiB pages, the delta can be up toceil(65536/1728) = 38for RX andceil(65536/6144) = 11for TX, which exceeds the previous hard-coded tolerance of ±5.This PR:
PAGE_SIZEviagetconf PAGE_SIZEceil(PAGE_SIZE / section_size)expected_rxinstead ofexpected_txValidation Results