Skip to content

RFC virtio/vsock: introduce SOCK_DGRAM support

Jiang Wang kvm lkml netdev virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest5 patches 2 repliesIn review
  2. v1 RFC6 patches 20 repliesSuperseded

Changes in v2 from the cover letter

- fix migration bug in vhost-vsock
- rename some variables
- clean up some code in virtio-vsock
- use le_to_cpu16 in virtio-vsock

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bitdrivers/vhost/vsock.c include/linux/virtio_vsock.h include/uapi/linux/virtio_vsock.h +1 more+82 -110 replies
2/5virtio/vsock: add support for virtio datagraminclude/net/af_vsock.h include/trace/events/vsock_virtio_transport_common.h include/uapi/linux/virtio_vsock.h +3 more+467 -741 reply
3/5vhost/vsock: add support for vhost dgram.drivers/vhost/vsock.c+189 -281 reply
4/5vsock_test: add tests for vsock dgramtools/testing/vsock/util.c tools/testing/vsock/util.h tools/testing/vsock/vsock_test.c+304 -00 replies
5/5virtio/vsock: add sysfs for rx buf len for dgramnet/vmw_vsock/virtio_transport.c+44 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC v2 0/5] virtio/vsock: introduce SOCK_DGRAM support

This patchset implements support of SOCK_DGRAM for virtio transport.

Datagram sockets are connectionless and unreliable. To avoid unfair contention with stream and other sockets, add two more virtqueues and
a new feature bit to indicate if those two new queues exist or not.

Dgram does not use the existing credit update mechanism for stream sockets. When sending from the guest/driver, sending packets synchronously, so the sender will get an error when the virtqueue is full. When sending from the host/device, send packets asynchronously because the descriptor memory belongs to the corresponding QEMU process.

The virtio spec patch is here:
https://www.mail-archive.com/[email protected]/msg47457.html

For those who prefer git repo, here is the link for the linux kernel:
https://github.com/Jiang1155/linux/tree/vsock-dgram-v2

qemu patch link:
https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg03462.html

To do:
1. use skb when receiving packets
2. support multiple transport
3. support mergeable rx buffer
4. support disabling F_STREAM feature bit

v1 -> v2 :
- fix migration bug in vhost-vsock
- rename some variables
- clean up some code in virtio-vsock
- use le_to_cpu16 in virtio-vsock

Jiang Wang (5):
virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit virtio/vsock: add support for virtio datagram vhost/vsock: add support for vhost dgram.
vsock_test: add tests for vsock dgram virtio/vsock: add sysfs for rx buf len for dgram

 drivers/vhost/vsock.c                         | 220 +++++++--
 include/linux/virtio_vsock.h                  |   9 +
 include/net/af_vsock.h                        |   1 +
 .../events/vsock_virtio_transport_common.h    |   2 +
 include/uapi/linux/virtio_vsock.h             |   3 +
 net/vmw_vsock/af_vsock.c                      |  12 +
 net/vmw_vsock/virtio_transport.c              | 463 +++++++++++++++---
 net/vmw_vsock/virtio_transport_common.c       | 181 ++++++-
 tools/testing/vsock/util.c                    | 105 ++++
 tools/testing/vsock/util.h                    |   4 +
 tools/testing/vsock/vsock_test.c              | 195 ++++++++
 11 files changed, 1083 insertions(+), 112 deletions(-)
Signature · 1 line
2.20.1