Skip to content

Add packed virtqueue support #301

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

prakash-shekhar
Copy link

Summary of the PR

Adds support for packed virtqueues, implementing the VirtIO packed virtqueue format alongside the existing split virtqueue support. Packed virtqueues offer improved performance through better cache locality and reduced memory overhead compared to traditional split virtqueues.

Changes:

  1. VringConfigData structure (src/backend.rs):
    - Updated documentation to clearly distinguish between split and packed virtqueue address semantics
    - For packed virtqueues: desc_table_addr becomes the packed descriptor ring, used_ring_addr becomes driver event suppression, avail_ring_addr becomes device event suppression
  2. vhost-user protocol support (src/vhost_user/message.rs):
    - Added RING_PACKED feature flag (bit 34, value 0x4_0000_0000)
    - Added VHOST_VRING_F_PACKED vring flag (bit 1, value 0x2)
    - Implemented packed virtqueue inflight I/O structures (DescStatePacked, QueueRegionPacked)
  3. vhost-kern support (src/vhost_kern/mod.rs):
    - Extended kernel backend to support packed virtqueue address configuration
    - Added handling of packed layout in vring setup
  4. Test coverage:
    - Added test_packed_virtqueue_features() to validate feature flag definitions
    - Added test_packed_vring_addr_validation() to test packed virtqueue address validation/alignment

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

prakash-shekhar and others added 6 commits June 12, 2025 20:55
Signed-off-by: Prakash Shekhar <[email protected]>
Signed-off-by: Prakash Shekhar <[email protected]>
Bump virtio-queue from v0.14.0 to v0.15.0

Bump virtio-bindings from v0.2.1 to v0.2.5

Signed-off-by: Jinank Jain <[email protected]>
Signed-off-by: Prakash Shekhar <[email protected]>
This release upgraded virtio-queue and virtio-bindings to latest
released version.

Signed-off-by: Jinank Jain <[email protected]>
Signed-off-by: Prakash Shekhar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants