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
Add AF_VSOCK support #47
Conversation
8206261
to
b4951b0
Compare
|
@stefano-garzarella Thanks for the PR. @tuexen Do you have some time to review this? |
I can take a look at it next week or so, but I'm no familiar with Linux and VSOCK in particular. |
b4951b0
to
af7b315
Compare
|
Thanks @stefano-garzarella for adding the support for vsock to uperf I mean to use it in our testing. I gave it a quick functional try and following setup worked well for me:
Note the opposite direction (running |
af7b315
to
f0cbb1f
Compare
|
@ldoktor thanks for testing and reporting the issues.
I should fixed this one, the problem was that vsock uses unsigned int port numbers, so uperf can fail with "Error creating ports:" error message also if everything is fine. |
|
@stefano-garzarella thank you, this version seem to address the issue mentioned earlier. |
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.
Looks good to me
The new `-S` command line option, allow to specify the protocol type to use for the control socket. This is necessary for vsock, where we don't have TCP available to connect to the remote host.
The VSOCK address family facilitates communication between virtual machines and the host they are running on. The addressing is formed by 2 integers: <CID, port> - CID: Context ID, it is the ID assigned to the VM 0, 1, 2 CIDs are reserved: 0 - hypervisor CID (rarely used) 1 - local communication (loopback) 2 - host CID (the guest can always reach the host using CID=2) - port: port number on 32bit to reach a specific process
vsock tests don't support h="localhost" and need to use vsock also for the control socket. We enable these things for all tests that end with *.vsock.xml
You have to run also `uperf -s -S vsock` in the background before running `make check` when vsock is enabled.
vsock uses unsigned int port numbers, so uperf can fail with "Error creating ports:" error message also if everything is fine. Let's check UPERF_FAILURE (-1) instead of negative return value, since we always return that value on failure and vsock ports -1 is reserved (VMADDR_PORT_ANY). Reported-by: Lukáš Doktor <ldoktor@redhat.com>
f0cbb1f
to
5f5b1f4
Compare
|
@tuexen thanks for the review! I just pushed the fixes. |
|
Merged. Thanks for addressing my issues. |
The VSOCK address family facilitates communication between virtual machines and the host they are running on.
AF_VSOCK currently support STREAM, SEQPACKET. DGRAM support is WiP.
The addressing is formed by 2 integers: <CID, port>
CID: Context ID, it is the ID assigned to the VM
0, 1, 2 CIDs are reserved:
0 - hypervisor CID (rarely used)
1 - local communication (loopback)
2 - host CID (the guest can always reach the host using CID=2)
port: port number on 32bit to reach a specific process
Added also tests using the
vsock_loopbackkernel module on a single host.This module (Linux v5.8+) allows to use AF_VSOCK on a single host, without spawning a VM.
Other info and examples of AF_VSOCK (socat, iperf, python, etc.) are summarized in this 2 talks: