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

[Feature Request] Add SEQPACKET socket type for vsock #4822

Open
3 tasks done
gabivlj opened this issue Sep 27, 2024 · 1 comment
Open
3 tasks done

[Feature Request] Add SEQPACKET socket type for vsock #4822

gabivlj opened this issue Sep 27, 2024 · 1 comment
Labels
Status: Parked Indicates that an issues or pull request will be revisited later Type: Enhancement Indicates new feature requests

Comments

@gabivlj
Copy link

gabivlj commented Sep 27, 2024

Feature Request

https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html

VIRTIO_VSOCK_F_SEQPACKET has been introduced as an option for virtio vsock. It would enable the use-case of VMs that are relaying datagrams over a vsock and need to keep the boundaries without a SOCK_STREAM combining them together.

Right now you can connect from the VM opening a vsock with SOCK_STREAM type, but not with SOCK_SEQPACKET. This would also mean that on the host side the created UDS needs to match the socket type of the vsock.

Describe the desired solution

This should work:

	socketFd, err := unix.Socket(unix.AF_VSOCK, unix.SOCK_SEQPACKET, 0)
	if err != nil {
		return nil, 0, err
	}

	sockaddr := &unix.SockaddrVM{
		CID:  2,
		Port: 500,
	}
	if err := unix.Connect(socketFd, sockaddr); err != nil {
		return nil, 0, err
	}

And if the opened UDS on the host side doesn't match the sock type it should not go ahead with the connection.

Describe possible alternatives

I worked around this by implementing packet boundaries within the stream socket, but it's clearly a not very efficient solution and slow.

Checks

  • Have you searched the Firecracker Issues database for similar requests?
  • Have you read all the existing relevant Firecracker documentation?
  • Have you read and understood Firecracker's core tenets?

I am curious if this is something the Firecracker team is interested in implementing for their vsock virtio component.

@JackThomson2
Copy link
Contributor

Hi gabivlj,
Thank you very much for your interest into Firecracker and this feature request.
While at the moment we are not actively working to implement this feature, we are more than happy to receive contribution from the community to implement it. We will make sure to review any implementation of it.
Thanks,
Jack

@JackThomson2 JackThomson2 added Type: Enhancement Indicates new feature requests Status: Parked Indicates that an issues or pull request will be revisited later labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Parked Indicates that an issues or pull request will be revisited later Type: Enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

2 participants