Skip to content

feat(virtq): add packed virtio ring primitives#1382

Open
andreiltd wants to merge 5 commits intohyperlight-dev:mainfrom
andreiltd:tandr/virtq-1-ring
Open

feat(virtq): add packed virtio ring primitives#1382
andreiltd wants to merge 5 commits intohyperlight-dev:mainfrom
andreiltd:tandr/virtq-1-ring

Conversation

@andreiltd
Copy link
Copy Markdown
Member

@andreiltd andreiltd commented Apr 16, 2026

Add low-level packed virtqueue ring implementation in hyperlight_common::virtq, based on the virtio packed ring format.

This is split from: #1368 and does not include any actual plumbing for guest/host communication.

Useful materials:

@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch from 3db3820 to bd2fd96 Compare April 16, 2026 10:20
@andreiltd andreiltd added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Apr 16, 2026
@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch 2 times, most recently from b4c8142 to 16de50c Compare April 16, 2026 10:30
Copy link
Copy Markdown
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

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

Great stuff, @andreiltd !
I left a few comments, most are small remarks, others are things I might have missed.
This is part 1 of my review, I still have some things left to look at that I plan on doing tomorrow.

Comment thread src/hyperlight_common/src/virtq/access.rs Outdated
Comment thread src/hyperlight_common/src/virtq/access.rs Outdated
Comment thread src/hyperlight_common/src/virtq/desc.rs Outdated
Comment thread src/hyperlight_common/src/virtq/desc.rs Outdated
Comment thread src/hyperlight_common/src/virtq/desc.rs Outdated
Comment thread src/hyperlight_common/src/virtq/event.rs Outdated
Comment thread src/hyperlight_common/src/virtq/ring.rs
/// and readable buffers must be added before writable buffers.
#[derive(Debug, Default)]
pub struct BufferChainBuilder<T> {
elems: SmallVec<[BufferElement; 16]>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe documenting this 16 inline capacity as an optimization for the user to be aware

Comment thread src/hyperlight_common/src/virtq/ring.rs Outdated
Comment thread src/hyperlight_common/src/virtq/ring.rs Outdated
@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch from dbc4b97 to 60563c4 Compare April 20, 2026 12:29
Add low-level packed virtqueue ring implementation in
hyperlight_common::virtq, based on the virtio packed ring format.

Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch from 60563c4 to f356539 Compare April 22, 2026 11:08
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch from f356539 to 3aaa98e Compare April 22, 2026 11:09
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd andreiltd force-pushed the tandr/virtq-1-ring branch from 857f4bf to 2c6adcb Compare April 22, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants