From: Sergio Lopez <slp@redhat.com>
To: "Stefano Garzarella" <sgarzare@redhat.com>,
"Bobby Eshleman" <bobbyeshleman@meta.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Bryan Tan" <bryan-bt.tan@broadcom.com>,
"Vishnu Dasa" <vishnu.dasa@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowangio@gmail.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Haiyang Zhang" <haiyangz@microsoft.com>,
"Wei Liu" <wei.liu@kernel.org>,
"Dexuan Cui" <decui@microsoft.com>
Cc: virtualization@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
bpf@vger.kernel.org, linux-hyperv@vger.kernel.org,
Sergio Lopez <slp@redhat.com>
Subject: [PATCH RFC 0/8] vsock: add datagram support to virtio and vhost
Date: Wed, 28 Oct 2026 17:04:29 +0100 [thread overview]
Message-ID: <20261028-vsock-dgram-support-v1-0-e457cf7cee78@sinrega.org> (raw)
This series implements SOCK_DGRAM support for virtio-vsock and
vhost-vsock, allowing applications to exchange connectionless messages
through the existing AF_VSOCK datagram API.
Support is negotiated through VIRTIO_VSOCK_F_DGRAM. Each datagram uses
a single VIRTIO_VSOCK_TYPE_DGRAM packet, supporting payloads from zero
bytes through 64 KiB. Pending sends are bounded by the socket send
buffer rather than peer credits, with queue accounting and poll
readiness reflecting pending output.
Datagrams use destination-based routing across guest-to-host,
host-to-guest and loopback transports while retaining the socket's
transport state. VMCI keeps priority as the dedicated datagram
transport. Guest RX buffers accommodate complete messages when
datagrams are negotiated, preserving message boundaries.
The patches first expose the core port allocator and add datagram
queue reporting, then implement the common data path, guest and host
feature negotiation, directional routing and RX buffer handling. The
final patch extends vsock_test with local and host/guest datagram
coverage, including peer filtering, route changes, message boundaries
and queue ioctls. Unsupported cases skip automatically.
Tested using QEMU with a patch that exposed the VIRTIO_VSOCK_F_DGRAM
feature:
https://lists.gnu.org/archive/html/qemu-devel/2026-10/msg08074.html
Code was written and reviewed both manually and assisted by Codex
(GPT-6.1-Sol) and Claude (Opus 4.6).
Signed-off-by: Sergio Lopez <slp@redhat.com>
---
Sergio Lopez (8):
vsock: expose the core port allocator to transports
vsock: report datagram receive and send queue state
vsock/virtio: implement the datagram data path
vsock/virtio: negotiate datagram support on the guest
vhost/vsock: negotiate datagram support with guests
vsock: allow datagrams to use directional transports
vsock: preserve host-to-guest datagram boundaries
vsock: add datagram tests to vsock_test
drivers/vhost/vsock.c | 37 +-
include/linux/virtio_vsock.h | 6 +
include/net/af_vsock.h | 14 +-
include/uapi/linux/virtio_vsock.h | 2 +
net/vmw_vsock/af_vsock.c | 206 ++++++--
net/vmw_vsock/hyperv_transport.c | 4 +
net/vmw_vsock/virtio_transport.c | 71 ++-
net/vmw_vsock/virtio_transport_common.c | 197 +++++++-
net/vmw_vsock/vmci_transport.c | 10 +
net/vmw_vsock/vsock_bpf.c | 3 +-
net/vmw_vsock/vsock_loopback.c | 1 +
tools/testing/vsock/Makefile | 3 +-
tools/testing/vsock/README | 23 +-
tools/testing/vsock/util.c | 62 +--
tools/testing/vsock/util.h | 10 +
tools/testing/vsock/vsock_test.c | 154 +++++-
tools/testing/vsock/vsock_test_dgram.c | 809 ++++++++++++++++++++++++++++++++
tools/testing/vsock/vsock_test_dgram.h | 26 +
18 files changed, 1545 insertions(+), 93 deletions(-)
---
base-commit: 65ba8f34ec886ec72b2c07ddc8cf3d815c32869d
change-id: 20261027-vsock-dgram-support-683a4e0aebe7
Best regards,
--
Sergio Lopez <slp@sinrega.org>
next reply other threads:[~2026-10-28 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 16:04 Sergio Lopez [this message]
2026-10-28 16:04 ` [PATCH RFC 1/8] vsock: expose the core port allocator to transports Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 2/8] vsock: report datagram receive and send queue state Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 3/8] vsock/virtio: implement the datagram data path Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 4/8] vsock/virtio: negotiate datagram support on the guest Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 5/8] vhost/vsock: negotiate datagram support with guests Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 6/8] vsock: allow datagrams to use directional transports Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 7/8] vsock: preserve host-to-guest datagram boundaries Sergio Lopez
2026-10-28 16:04 ` [PATCH RFC 8/8] vsock: add datagram tests to vsock_test Sergio Lopez
2026-10-28 17:25 ` [PATCH RFC 0/8] vsock: add datagram support to virtio and vhost Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028-vsock-dgram-support-v1-0-e457cf7cee78@sinrega.org \
--to=slp@redhat.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bobbyeshleman@meta.com \
--cc=bpf@vger.kernel.org \
--cc=bryan-bt.tan@broadcom.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@kernel.org \
--cc=eperezma@redhat.com \
--cc=haiyangz@microsoft.com \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=vishnu.dasa@broadcom.com \
--cc=wei.liu@kernel.org \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®