Skip to content
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

[PAL/vm-common] vsock: add guest-side vsock buf management #26

Open
wants to merge 1 commit into
base: intel_tdx
Choose a base branch
from

Conversation

dimakuv
Copy link

@dimakuv dimakuv commented May 2, 2024

Description of the changes

The guest (our Gramine) should use tx_cnt, peer_fwd_cnt and peer_buf_alloc to calculate the number of bytes currently available in the host buffer, and thus currently possible for Gramine to send on a particular connection (particular virtual socket). Previously, we didn't implement this guest-side buffer space management which could lead to app's select/poll/epoll incorrectly returning POLLOUT events.

This commit fixes this by implementing guest-side buffer space management as outlined by the virtio spec.

How to test this PR?

Actually, Redis and Memcached seem to not use this (i.e., don't perform poll(..., POLLOUT)). So I couldn't really test it, only in my head.


This change is Reviewable

@dimakuv dimakuv force-pushed the dimakuv/vsock-add-guest-buf-management branch from 139c9ee to f78afce Compare July 10, 2024 08:51
@dimakuv dimakuv force-pushed the dimakuv/vsock-add-guest-buf-management branch from f78afce to b798656 Compare July 19, 2024 08:50
The guest (our Gramine) should use `tx_cnt`, `peer_fwd_cnt` and
`peer_buf_alloc` to calculate the number of bytes currently available in
the host buffer, and thus currently possible for Gramine to send on a
particular connection (particular virtual socket). Previously, we didn't
implement this guest-side buffer space management which could lead to
app's select/poll/epoll incorrectly returning POLLOUT events.

This commit fixes this by implementing guest-side buffer space
management as outlined by the virtio spec.

Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
@dimakuv dimakuv force-pushed the dimakuv/vsock-add-guest-buf-management branch from b798656 to 5e8a17f Compare July 19, 2024 09:22
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.

1 participant