kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] virtio/vsock: introduce SOCK_SEQPACKET support.
@ 2021-01-03 19:54 Arseny Krasnov
  2021-01-03 19:57 ` [PATCH 1/5] vsock/virtio: support for SOCK_SEQPACKET socket Arseny Krasnov
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Arseny Krasnov @ 2021-01-03 19:54 UTC (permalink / raw)
  To: Stefan Hajnoczi, Stefano Garzarella, Michael S. Tsirkin,
	Jason Wang, David S. Miller, Jakub Kicinski, Colin Ian King,
	Jorgen Hansen, Arseniy Krasnov, Andra Paraschiv,
	Jeff Vander Stoep
  Cc: kvm, virtualization, netdev, linux-kernel, stsp2, arseny.krasnov

	As SOCK_SEQPACKET guarantees to save record boundaries, so to
do it, new packet operation was added: it marks start of record (with
record length in header). To send record, packet with start marker is
sent first, then all data is transmitted as 'RW' packets. On receiver's
side, length of record is known from packet with start record marker.
Now as  packets of one socket are not reordered neither on vsock nor on
vhost transport layers, these marker allows to restore original record
on receiver's side. When each 'RW' packet is inserted to rx queue of
receiver, user is woken up, data is copied to user's buffer and credit
update message is sent. If there is no user waiting for data, credit
won't be updated and sender will wait. Also,  if user's buffer is full,
and record is bigger, all unneeded data will be dropped (with sending of
credit update message).
	'MSG_EOR' flag is implemented with special value of 'flags' field
in packet header. When record is received with such flags, 'MSG_EOR' is
set in 'recvmsg()' flags. 'MSG_TRUNC' flag is also supported.
	In this implementation maximum length of datagram is not limited
as in stream socket.

 drivers/vhost/vsock.c                   |   6 +-
 include/linux/virtio_vsock.h            |   7 +
 include/net/af_vsock.h                  |   4 +
 include/uapi/linux/virtio_vsock.h       |   9 +
 net/vmw_vsock/af_vsock.c                | 457 +++++++++++++++++++-----
 net/vmw_vsock/virtio_transport.c        |   3 +
 net/vmw_vsock/virtio_transport_common.c | 323 ++++++++++++++---
 7 files changed, 673 insertions(+), 136 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-01-11  6:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 19:54 [PATCH 0/5] virtio/vsock: introduce SOCK_SEQPACKET support Arseny Krasnov
2021-01-03 19:57 ` [PATCH 1/5] vsock/virtio: support for SOCK_SEQPACKET socket Arseny Krasnov
2021-01-03 21:07   ` stsp
2021-01-06 19:24     ` Arseny Krasnov
2021-01-08 10:19   ` Stefano Garzarella
2021-01-03 20:03 ` [PATCH 2/5] vhost/vsock: " Arseny Krasnov
2021-01-03 20:03 ` [PATCH 3/5] af_vsock: send/receive loops for SOCK_SEQPACKET Arseny Krasnov
2021-01-03 20:49   ` stsp
2021-01-11  6:44     ` Arseny Krasnov
2021-01-03 20:04 ` [PATCH 4/5] af_vsock: add socket ops " Arseny Krasnov
2021-01-03 21:15   ` stsp
2021-01-06 19:29     ` Arseny Krasnov
2021-01-03 20:04 ` [PATCH 5/5] af_vsock: update comments for stream sockets Arseny Krasnov
2021-01-03 21:18 ` [PATCH 0/5] virtio/vsock: introduce SOCK_SEQPACKET support stsp
2021-01-06 19:33   ` Arseny Krasnov
2021-01-08 10:33 ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).