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
Contributor

@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

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 <dmitrii.kuvaiskii@intel.com>
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.

None yet

1 participant