-
Notifications
You must be signed in to change notification settings - Fork 51
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: Fix issues with sibling VM communication #385
vsock: Fix issues with sibling VM communication #385
Conversation
6a11b01
to
600f053
Compare
CI fails with |
600f053
to
7ae35ad
Compare
/cc @germag |
7ae35ad
to
409dfb6
Compare
Resolved starvation of the raw packets queue from the standard RX queue. |
409dfb6
to
808a45e
Compare
Rebased over main. |
The deadlock occurs when two sibling VMs simultaneously try to send each other packets. The `VhostUserVsockThread`s corresponding to both the VMs hold their own locks while executing `thread_backend.send_pkt` and then try to lock each other to access their counterpart's `raw_pkts_queue`. This ultimately results in a deadlock. Resolved by separating the mutex over `raw_pkts_queue` from the mutex over `VhostUserVsockThread`. Signed-off-by: Priyansh Rathi <[email protected]>
808a45e
to
9e048b2
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 comment about rx handling
Regarding issue #384, what things are missing that need to be resolved? |
9e048b2
to
6fe6d98
Compare
Moved the RX handling (queue switching on each iteration to prevent starvation) to |
Even with the fixes introduced in this PR, iperf-vsock does not seem to work. Logging the packet traffic received by the vhost-user-vsock application reveals that after sending only a few RW packets, the client stops sending any more packets. Following could be the reasons for this problem:
|
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 little thing if you want: I'd replace process_standard_rx
with process_unix_sockets
. We can also remove pub
from it.
Regarding issue #384, what things are missing that need to be resolved?
Okay thanks! Can you update the issue with this information? |
Currently, the `raw_pkts_queue` is processed only when a `SIBLING_VM_EVENT` is received. But it may happen that the `raw_pkts_queue` could not be processed completely due to insufficient space in the RX virtqueue at that time. So, try to process raw packets on other events too similar to what happens in the RX of standard packets. Signed-off-by: Priyansh Rathi <[email protected]>
6fe6d98
to
3258eed
Compare
Done. |
@mathieupoirier @vireshk @stsquad can you take a look? |
This PR attempts to resolve issues with sibling VM communication described in #384.
Resolves partially #384.