Skip to content

feat(vsock): Add VIRTIO_RING_F_EVENT_IDX support#5872

Open
Manciukic wants to merge 3 commits into
firecracker-microvm:mainfrom
Manciukic:vsock-notif-suppression
Open

feat(vsock): Add VIRTIO_RING_F_EVENT_IDX support#5872
Manciukic wants to merge 3 commits into
firecracker-microvm:mainfrom
Manciukic:vsock-notif-suppression

Conversation

@Manciukic
Copy link
Copy Markdown
Contributor

@Manciukic Manciukic commented May 11, 2026

Changes

Enables notification suppression in vsock device through EVENT_IDX feature:

  • Advertise VIRTIO_RING_F_EVENT_IDX in AVAIL_FEATURES
  • Call enable_notif_suppression() on activate when EVENT_IDX is negotiated
  • Use pop_or_enable_notification() in process_rx/process_tx (matching block/net pattern)
  • Gate return value with prepare_kick() so signal_used_queues is only called for queues that actually need a kick, preserving the existing trigger_queues coalescing optimization

Reason

Notif suppression is used in net and block as well, and achieves up to 2x better h2g throughput on MMIO with no g2h regression. On PCI, h2g is up to 10% better on Graviton, g2h is up to 20% better on AMD.

Transport Instance tput_g2h tput_h2g lat_g2h
MMIO m5n.metal +0.2% +130.1% -1.2%
MMIO m6a.metal +5.1% +132.5% +0.0%
MMIO m6g.metal -0.1% +56.6% +1.6%
MMIO m6i.metal -5.4% +118.4% -1.5%
MMIO m7a.metal-48xl -0.2% +110.3% +0.0%
MMIO m7g.metal -2.8% +67.3% +1.9%
MMIO m7i.metal-24xl -2.6% +114.0% +0.0%
MMIO m7i.metal-48xl -2.5% +123.2% -1.2%
MMIO m8g.metal-24xl -1.5% +82.5% -2.3%
MMIO m8g.metal-48xl +12.4% +77.0% +2.3%
MMIO m8i.metal-48xl +12.2% +122.5% +0.0%
MMIO m8i.metal-96xl -10.2% +118.8% +1.3%
PCI m5n.metal +0.3% -1.3% +2.2%
PCI m6a.metal +21.6% +3.2% +0.0%
PCI m6g.metal -0.5% +6.6% +2.1%
PCI m6i.metal -1.5% -3.3% +2.3%
PCI m7a.metal-48xl +24.1% -2.1% +1.7%
PCI m7g.metal -1.4% +9.5% +2.6%
PCI m7i.metal-24xl -2.6% -11.3% +5.2%
PCI m7i.metal-48xl -0.6% -6.7% +1.7%
PCI m8g.metal-24xl -0.8% +6.5% +0.0%
PCI m8g.metal-48xl -0.7% +6.6% +0.0%
PCI m8i.metal-48xl +0.2% -1.4% -1.3%
PCI m8i.metal-96xl -12.7% -5.3% +4.0%

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

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.90%. Comparing base (9b53e62) to head (05c4846).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5872   +/-   ##
=======================================
  Coverage   82.90%   82.90%           
=======================================
  Files         277      277           
  Lines       30053    30058    +5     
=======================================
+ Hits        24914    24919    +5     
  Misses       5139     5139           
Flag Coverage Δ
5.10-m5n.metal 83.20% <100.00%> (+<0.01%) ⬆️
5.10-m6a.metal 82.54% <100.00%> (+<0.01%) ⬆️
5.10-m6g.metal 79.84% <100.00%> (+<0.01%) ⬆️
5.10-m6i.metal 83.20% <100.00%> (+<0.01%) ⬆️
5.10-m7a.metal-48xl 82.53% <100.00%> (+<0.01%) ⬆️
5.10-m7g.metal 79.84% <100.00%> (+<0.01%) ⬆️
5.10-m7i.metal-24xl 83.18% <100.00%> (+0.01%) ⬆️
5.10-m7i.metal-48xl 83.18% <100.00%> (+0.01%) ⬆️
5.10-m8g.metal-24xl 79.83% <100.00%> (+<0.01%) ⬆️
5.10-m8g.metal-48xl 79.84% <100.00%> (+<0.01%) ⬆️
5.10-m8i.metal-48xl 83.17% <100.00%> (+<0.01%) ⬆️
5.10-m8i.metal-96xl 83.17% <100.00%> (+<0.01%) ⬆️
6.1-m5n.metal 83.23% <100.00%> (+<0.01%) ⬆️
6.1-m6a.metal 82.57% <100.00%> (+<0.01%) ⬆️
6.1-m6g.metal 79.84% <100.00%> (+<0.01%) ⬆️
6.1-m6i.metal 83.23% <100.00%> (+<0.01%) ⬆️
6.1-m7a.metal-48xl 82.56% <100.00%> (+<0.01%) ⬆️
6.1-m7g.metal 79.84% <100.00%> (+<0.01%) ⬆️
6.1-m7i.metal-24xl 83.23% <100.00%> (+<0.01%) ⬆️
6.1-m7i.metal-48xl 83.24% <100.00%> (+<0.01%) ⬆️
6.1-m8g.metal-24xl 79.84% <100.00%> (+<0.01%) ⬆️
6.1-m8g.metal-48xl 79.84% <100.00%> (+<0.01%) ⬆️
6.1-m8i.metal-48xl 83.24% <100.00%> (+<0.01%) ⬆️
6.1-m8i.metal-96xl 83.24% <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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Manciukic Manciukic force-pushed the vsock-notif-suppression branch 2 times, most recently from f469021 to 7ce0e6e Compare May 12, 2026 14:59
@Manciukic Manciukic marked this pull request as ready for review May 12, 2026 14:59
@Manciukic Manciukic requested a review from micz010 as a code owner May 12, 2026 14:59
@Manciukic Manciukic added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label May 12, 2026
JackThomson2
JackThomson2 previously approved these changes May 13, 2026
Comment thread src/vmm/src/devices/virtio/vsock/device.rs
@ilstam
Copy link
Copy Markdown
Contributor

ilstam commented May 14, 2026

LGTM. I wonder if we have any way of testing this, other than the improved performance numbers.

ilstam
ilstam previously approved these changes May 15, 2026
JackThomson2
JackThomson2 previously approved these changes May 15, 2026
Manciukic added 3 commits May 15, 2026 11:40
Remove commented-out code and unused VSOCK_NUM_QUEUES import.

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Enables notification suppression in vsock device through EVENT_IDX
feature:

- Advertise VIRTIO_RING_F_EVENT_IDX in AVAIL_FEATURES
- Call enable_notif_suppression() on activate when EVENT_IDX is
  negotiated
- Use pop_or_enable_notification() in process_rx/process_tx
- Gate return value with prepare_kick() so signal_used_queues is only
  called for queues that actually need a kick, preserving the existing
  trigger_queues coalescing optimization

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
Add a CHANGELOG.md entry documenting the new notification suppression
support in the virtio-vsock device via the EVENT_IDX virtio feature.

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
@Manciukic Manciukic dismissed stale reviews from ilstam and JackThomson2 via 05c4846 May 15, 2026 11:40
@Manciukic Manciukic force-pushed the vsock-notif-suppression branch from 0e4ed33 to 05c4846 Compare May 15, 2026 11:40
@ShadowCurse ShadowCurse enabled auto-merge (rebase) May 15, 2026 15:37
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants