-
Notifications
You must be signed in to change notification settings - Fork 2k
vsock: reuse IoVecBuffer(Mut) buffers for packets within a device #4842
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: reuse IoVecBuffer(Mut) buffers for packets within a device #4842
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4842 +/- ##
==========================================
+ Coverage 84.35% 84.38% +0.03%
==========================================
Files 249 249
Lines 27505 27494 -11
==========================================
- Hits 23202 23201 -1
+ Misses 4303 4293 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2842692
to
374deae
Compare
Add rx_packet and tx_packet members to the Vsock type and reuse them for RX and TX processing. This removed overhead of creating new packets for each request. As an additional improvement, we split VsockPacket type into 2 types: VsockPacketRx and VsockPacketTx which allows us to separate logic for RX and TX processing. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
8c55639
to
a71f521
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.
LGTM. Just a couple of nits.
Can you please run A/B for this change before merging?
a71f521
to
4ef1fd6
Compare
As we don't create IoVecBuffer(Mut) types at runtime, but reuse existing ones in both virtio-net and virtio-vsock, we don't need to use SmallVec type anymore. With this we remove the type alias. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
4ef1fd6
to
9720925
Compare
Changes
Make
vsock
reuse packets for RX and TX paths. This removes overhead of creating packets from the virt queues.This also should prevent regressions from #4799.
Reason
Improved performance.
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
PR.
CHANGELOG.md
.TODO
s link to an issue.contribution quality standards.
rust-vmm
.