Skip to content

Add Packed Descriptor #310

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

Merged
merged 4 commits into from
Mar 4, 2025
Merged

Add Packed Descriptor #310

merged 4 commits into from
Mar 4, 2025

Conversation

uran0sH
Copy link
Contributor

@uran0sH uran0sH commented Sep 25, 2024

Summary of the PR

This PR is primarily aimed at preparing for the support of packed vring.
The struct Descriptor in desc/mod.rs is a unified memory layout representation.
The struct Descriptor in desc/split.rs represents the split descriptor.
The struct Descriptor in desc/packed.rs represents the packed descriptor.
And use the desc/split.rs and remove old stuff in descriptor.rs.

issue: #241

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.

@uran0sH uran0sH changed the title Add packed descriptor and MockPackedQueue [WIP] Add packed descriptor and MockPackedQueue Sep 25, 2024
@uran0sH uran0sH marked this pull request as draft September 25, 2024 16:17
Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

Thanks for working on that!

I left some small comments, but I'd suggest splitting in multiple commits, for example:

  1. Add SplitDescriptor
  2. Use SplitDescriptor
  3. remove old stuff in virtio-queue/src/descriptor.rs
  4. Add PackedDescriptor
  5. etc

BTW I noticed that virtio-queue/src/descriptor.rs is intact, should we remove Descriptor from there?

Please also add a nice description in commits and PR to explain what we are changing/adding.

@uran0sH uran0sH changed the title [WIP] Add packed descriptor and MockPackedQueue Add Packed Descriptor Oct 20, 2024
@uran0sH uran0sH marked this pull request as ready for review October 20, 2024 16:19
@stefano-garzarella
Copy link
Member

Please also add a nice description in commits and PR to explain what we are changing/adding.

Can you check this? ^
For us it's very important to have a descriptive commit, because in the future we may find some bugs and reading the description can help us to understand if the bug is related or not to a commit.
I'd also suggest adding entries to the changelog, especially now that this PR is not a draft anymore.

Also the CI seems not happy, can you check that?

Thanks :-)

@uran0sH uran0sH closed this Oct 22, 2024
@uran0sH uran0sH reopened this Oct 22, 2024
@uran0sH uran0sH force-pushed the mock-dev branch 9 times, most recently from 834766b to 4281589 Compare November 3, 2024 06:09
@uran0sH
Copy link
Contributor Author

uran0sH commented Nov 3, 2024

Please also add a nice description in commits and PR to explain what we are changing/adding.

Can you check this? ^ For us it's very important to have a descriptive commit, because in the future we may find some bugs and reading the description can help us to understand if the bug is related or not to a commit. I'd also suggest adding entries to the changelog, especially now that this PR is not a draft anymore.

Also the CI seems not happy, can you check that?

Thanks :-)
@stefano-garzarella Hi, I push a new version.
I have checked them. I don't know whether the commit message is clear. Please feel free to review it again. Thanks :-)

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

I have checked them. I don't know whether the commit message is clear. Please feel free to review it again. Thanks :-)

They look better, just some little notes:
Patch 1: I'd replace crate with module
Patch 2: You can remove "We", just start with "Use ..."
Patch 4: Add a little description with the stuff Added/Changed

About the changes visible to the user, do you have some examples on how user should update their crates. For example, will be nice to open a Draft PR in https://github.com/rust-vmm/vhost and https://github.com/rust-vmm/vhost-device with related changes.

@uran0sH uran0sH force-pushed the mock-dev branch 2 times, most recently from 25d251c to 4bf3e75 Compare December 19, 2024 15:30
@uran0sH
Copy link
Contributor Author

uran0sH commented Jan 25, 2025

I have checked them. I don't know whether the commit message is clear. Please feel free to review it again. Thanks :-)

They look better, just some little notes: Patch 1: I'd replace crate with module Patch 2: You can remove "We", just start with "Use ..." Patch 4: Add a little description with the stuff Added/Changed

About the changes visible to the user, do you have some examples on how user should update their crates. For example, will be nice to open a Draft PR in https://github.com/rust-vmm/vhost and https://github.com/rust-vmm/vhost-device with related changes.

A draft commit for vhost: uran0sH/vhost@54a8d90
and for vhost-device: uran0sH/vhost-device@d904b90

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

LGTM, I just left a very minimal comment

@stefano-garzarella
Copy link
Member

I have checked them. I don't know whether the commit message is clear. Please feel free to review it again. Thanks :-)

They look better, just some little notes: Patch 1: I'd replace crate with module Patch 2: You can remove "We", just start with "Use ..." Patch 4: Add a little description with the stuff Added/Changed
About the changes visible to the user, do you have some examples on how user should update their crates. For example, will be nice to open a Draft PR in https://github.com/rust-vmm/vhost and https://github.com/rust-vmm/vhost-device with related changes.

A draft commit for vhost: uran0sH/vhost@54a8d90 and for vhost-device: uran0sH/vhost-device@d904b90

Cool, so very minimal changes! Would be nice to open a draft PR for vhost-device fixing all the devices after we merge this PR.

@stefano-garzarella
Copy link
Member

@uran0sH there are some conflicts, can you rebase?

@uran0sH
Copy link
Contributor Author

uran0sH commented Feb 24, 2025

@uran0sH there are some conflicts, can you rebase?

done

@uran0sH
Copy link
Contributor Author

uran0sH commented Mar 3, 2025

@epilys ping

uran0sH added 4 commits March 4, 2025 08:49
Add a new module called desc for split and packed descriptor.
split.rs represents the split descriptor and packed.rs will
represent the packed descriptor.
The Descriptor struct in mod.rs represents the memory layout
of the split and packed descriptor.

Signed-off-by: Wenyu Huang <[email protected]>
Use 'virtio_queue::desc::split::Descriptor' to replace
'virtio_queue::Descriptor'.

Signed-off-by: Wenyu Huang <[email protected]>
Add the packed descriptor for support packed vring.

Signed-off-by: Wenyu Huang <[email protected]>
@epilys epilys enabled auto-merge (rebase) March 4, 2025 07:01
@epilys epilys merged commit 257c73d into rust-vmm:main Mar 4, 2025
2 checks passed
@stefano-garzarella
Copy link
Member

@epilys thanks for the review!
@uran0sH if you have time, will be great to open a Draft PR for https://github.com/rust-vmm/vhost-device to be prepared when we will release a new version of this crate

@uran0sH
Copy link
Contributor Author

uran0sH commented Apr 22, 2025

@epilys thanks for the review! @uran0sH if you have time, will be great to open a Draft PR for https://github.com/rust-vmm/vhost-device to be prepared when we will release a new version of this crate

@stefano-garzarella I have opened a draft pr for vhost-device(rust-vmm/vhost-device#834). But this pr only replaces the API for two types of devices. So, do we need to replace it for all devices? Or do you have a better suggestion?

@stefano-garzarella
Copy link
Member

@epilys thanks for the review! @uran0sH if you have time, will be great to open a Draft PR for https://github.com/rust-vmm/vhost-device to be prepared when we will release a new version of this crate

@stefano-garzarella I have opened a draft pr for vhost-device(rust-vmm/vhost-device#834). But this pr only replaces the API for two types of devices. So, do we need to replace it for all devices? Or do you have a better suggestion?

I think will be great to update it in all devices. Do you see any issue doing that?

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.

3 participants