Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase virtio-net queue size to 512 #4875

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

ShadowCurse
Copy link
Contributor

Changes

Make IovDeque to have configurable size and increase virtio-net queue size to 512. This helps with keeping both
vmm thread and guest busy at high network load and improves performance.
The increased queue size also leads to increased memory usage by 4 pages which is negligible compared to the overall VM memory usage.

Reason

Improved performance.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@ShadowCurse ShadowCurse self-assigned this Oct 28, 2024
@ShadowCurse ShadowCurse force-pushed the net_queue_512 branch 2 times, most recently from 5d48ede to ba3d75e Compare October 28, 2024 13:59
@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests Type: Performance labels Oct 28, 2024
@ShadowCurse ShadowCurse force-pushed the net_queue_512 branch 4 times, most recently from baed8d5 to 565258f Compare October 28, 2024 14:55
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.09%. Comparing base (2689dd6) to head (de35bb7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4875      +/-   ##
==========================================
- Coverage   84.10%   84.09%   -0.01%     
==========================================
  Files         251      251              
  Lines       28083    28074       -9     
==========================================
- Hits        23619    23610       -9     
  Misses       4464     4464              
Flag Coverage Δ
5.10-c5n.metal 84.67% <100.00%> (-0.01%) ⬇️
5.10-m5n.metal 84.65% <100.00%> (-0.02%) ⬇️
5.10-m6a.metal 83.96% <100.00%> (-0.01%) ⬇️
5.10-m6g.metal 80.78% <100.00%> (-0.01%) ⬇️
5.10-m6i.metal 84.66% <100.00%> (-0.01%) ⬇️
5.10-m7g.metal 80.78% <100.00%> (-0.01%) ⬇️
6.1-c5n.metal 84.66% <100.00%> (-0.01%) ⬇️
6.1-m5n.metal 84.65% <100.00%> (-0.02%) ⬇️
6.1-m6a.metal 83.96% <100.00%> (-0.02%) ⬇️
6.1-m6g.metal 80.78% <100.00%> (-0.01%) ⬇️
6.1-m6i.metal 84.66% <100.00%> (+<0.01%) ⬆️
6.1-m7g.metal 80.78% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ShadowCurse ShadowCurse force-pushed the net_queue_512 branch 3 times, most recently from 0d6c513 to 61fec0a Compare October 28, 2024 16:11
Copy link
Contributor

@bchalios bchalios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainly nits. but first commit message body needs a bit of rewording.

src/vmm/src/devices/virtio/iov_deque.rs Show resolved Hide resolved
src/vmm/src/devices/virtio/iov_deque.rs Show resolved Hide resolved
src/vmm/src/devices/virtio/iovec.rs Outdated Show resolved Hide resolved
@ShadowCurse ShadowCurse force-pushed the net_queue_512 branch 2 times, most recently from d6cff6f to 42aacca Compare October 29, 2024 17:03
Add a const generic parameter to specify the
length of the IovDeque. This way different devices can use
different sizes for the queue.

Signed-off-by: Egor Lazarchuk <[email protected]>
Increase of the queue size helps with keeping both
vmm thread and guest busy at high network load and
improves performance.

Signed-off-by: Egor Lazarchuk <[email protected]>
@bchalios bchalios merged commit 5a18ede into firecracker-microvm:main Oct 30, 2024
6 of 7 checks passed
@ShadowCurse ShadowCurse deleted the net_queue_512 branch October 30, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests Type: Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants