-
Notifications
You must be signed in to change notification settings - Fork 89
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
vsock: support header and data on a single descriptor #207
Conversation
0569dd6
to
49287f9
Compare
About the CI failure on the commit message, should I remove the links? |
No, we can merge the PR with admin rights when it'll be the time. |
@stefano-garzarella The tests that we are now using for generating the fuzz input are failing, can you take a look? |
Ooops, I forgot to adjust the descriptors in the fuzz subfolder. |
@stefano-garzarella if you do a rebase on top of main the |
49287f9
to
20253f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look over all the code, but I think it needs some adjustments. Will take a look at the rest tomorrow.
@stefano-garzarella I created a longer running fuzzing pipeline for PRs that runs fuzzing for 1 day, but doesn't block the merge of PRs. Do you mind if I do an update branch on your PR to trigger the run? |
It's fine, but the current branch doesn't include the change that I proposed to avoid the overflow. |
ah no, I thought was on main. So I'll send the new version and then you can update it. |
Yap, that's right! Once it is pushed once, then we can also retrigger it from github. But since the webhook was yet never called, GitHub doesn't know of its existence. |
20253f8
to
45c8c0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably get rid of some of the duplication in the tx and rx path, but I don't think that makes a lot of sense since we want to do a more generic refactoring anyway.
LGTM.
45c8c0a
to
07f8504
Compare
This documentation needs to be updated. |
We should probably also add a CHANGELOG entry for this, even if it's not an API change. |
7d7e19a
to
73761b0
Compare
new version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we publish this as a patch release, in that case we should follow this guide which involves creating a new branch etc.?
I don't think we need a patch release on a new branch unless we want to backport this fix to previous releases. We can just do patch releases from main as well as long as the history is linear, which is what I think is the case here. |
73761b0
to
aaa3281
Compare
new version:
|
Starting from Linux 6.2 the virtio-vsock driver can use a single descriptor for both header and data: https://lore.kernel.org/lkml/20221215043645.3545127-1-bobby.eshleman@bytedance.com/ So with this modification the virtio-vsock device can support header and data on a single descriptor or on two. This is just a Linux implementation detail though, for the spec it could be multiple descriptors as well. For now let's add only the single descriptor support, since it doesn't involve an API change, but in the future we should change the API and support an array of VolatileSlices as suggested by Laura here: rust-vmm#204 (comment) Let's make some tests working with this change and adding new tests to cover the single descriptor scenario. Fixes: rust-vmm#204 Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
When we use `vq.build_desc_chain()` in tests, we usually pass the entire array of descriptors, so there is no need to create a slice using a range, we can pass it all directly. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
aaa3281
to
8225eea
Compare
The 0.2.1 version of virtio-vsock crate contains a fix [1] needed to properly work with the virtio-vsock driver provided by Linux v6.3 and later (originally the new driver was supposed to be in v6.2, but it was postponed). The fix was just a quick workaround, but in the future more work will be needed in the virtio-vsock crate to not have a Linux-only specific implementation of VsockPacket, as described in this issue [2]. [1] rust-vmm/vm-virtio#207 [2] rust-vmm/vm-virtio#216 Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
The 0.2.1 version of virtio-vsock crate contains a fix [1] needed to properly work with the virtio-vsock driver provided by Linux v6.3 and later (originally the new driver was supposed to be in v6.2, but it was postponed). The fix was just a quick workaround, but in the future more work will be needed in the virtio-vsock crate to not have a Linux-only specific implementation of VsockPacket, as described in this issue [2]. [1] rust-vmm/vm-virtio#207 [2] rust-vmm/vm-virtio#216 Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Summary of the PR
Starting from Linux 6.2 the virtio-vsock driver can use a single descriptor for both header and data:
https://lore.kernel.org/lkml/20221215043645.3545127-1-bobby.eshleman@bytedance.com/
So with this modification the virtio-vsock device can support header and data on a single descriptor or on two. This is just a Linux implementation detail though, for the spec it could be multiple descriptors as well.
For now let's add only the single descriptor support, since it doesn't involve an API change, but in the future we should change the API and support an array of VolatileSlices as suggested by Laura here: #204 (comment)
Let's make the tests work with this change (mainly by always using PKT_HEADER_SIZE for the header descriptor) and adding new tests to cover the single descriptor scenario.
Fixes: #204
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commitmessage has max 60 characters for the summary and max 75 characters for each
description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.