[RFC PATCH net-next v6 14/14] test/vsock: add vsock dgram tests

2024-07-10 Thread Amery Hung
From: Bobby Eshleman From: Jiang Wang This commit adds tests for vsock datagram. Signed-off-by: Bobby Eshleman Signed-off-by: Jiang Wang Signed-off-by: Amery Hung --- tools/testing/vsock/util.c | 177 - tools/testing/vsock/util.h | 10 + tools/testing/vsock/vsock_test.c

[RFC PATCH net-next v6 13/14] virtio/vsock: implement datagram support

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit implements datagram support with a new version of ->dgram_allow(). Additionally, it drops virtio_transport_dgram_allow() as an exported symbol because it is no longer used in other transports. Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung --- includ

[RFC PATCH net-next v6 12/14] vsock/loopback: implement datagram support

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit implements datagram support for vsock loopback. Not much more than simply toggling on "dgram_allow" and continuing to use the common virtio functions. Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung --- net/vmw_vsock/vsock_loopback.c | 7 ++- 1 fi

[RFC PATCH net-next v6 11/14] vhost/vsock: implement datagram support

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit implements datagram support for vhost/vsock by teaching vhost to use the common virtio transport datagram functions. If the virtio RX buffer is too small, then the transmission is abandoned, the packet dropped, and EHOSTUNREACH is added to the socket's error queu

[RFC PATCH net-next v6 10/14] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit adds a feature bit for virtio vsock to support datagrams. Signed-off-by: Jiang Wang Signed-off-by: Bobby Eshleman --- include/uapi/linux/virtio_vsock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/virtio_vsock.h b/include/uapi/linux/

[RFC PATCH net-next v6 09/14] virtio/vsock: add common datagram recv path

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit adds the common datagram receive functionality for virtio transports. It does not add the vhost/virtio users of that functionality. This functionality includes: - changes to the virtio_transport_recv_pkt() path for finding the bound socket receiver for incoming

[RFC PATCH net-next v6 07/14] virtio/vsock: add common datagram send path

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit implements the common function virtio_transport_dgram_enqueue for enqueueing datagrams. It does not add usage in either vhost or virtio yet. Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung --- include/linux/virtio_vsock.h| 1 + include/net

[RFC PATCH net-next v6 08/14] af_vsock: add vsock_find_bound_dgram_socket()

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit adds vsock_find_bound_dgram_socket() which allows transports to find bound dgram sockets in the global dgram bind table. It is intended to be used for "routing" incoming packets to the correct sockets if the transport uses the global bind table. Signed-off-by: Bo

[RFC PATCH net-next v6 06/14] virtio/vsock: add VIRTIO_VSOCK_TYPE_DGRAM

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit adds the datagram packet type for inclusion in virtio vsock packet headers. It is included here as a standalone commit because multiple future but distinct commits depend on it. Signed-off-by: Bobby Eshleman --- include/uapi/linux/virtio_vsock.h | 1 + 1 file c

[RFC PATCH net-next v6 05/14] af_vsock: use a separate dgram bind table

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit adds support for bound dgram sockets to be tracked in a separate bind table from connectible sockets in order to avoid address collisions. With this commit, users can simultaneously bind a dgram socket and connectible socket to the same CID and port. Signed-off-b

[RFC PATCH net-next v6 04/14] af_vsock: generalize bind table functions

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit makes the bind table management functions in vsock usable for different bind tables. Future work will introduce a new table for datagrams to avoid address collisions, and these functions will be used there. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/af_vso

[RFC PATCH net-next v6 03/14] af_vsock: support multi-transport datagrams

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This patch adds support for multi-transport datagrams. This includes: - Allow transport to be undecided (i.e., empty) for non-VMCI datagram use cases during socket creation. - connect() now assigns the transport for (similar to connectible sockets) - Per-packet lookup of

[RFC PATCH net-next v6 02/14] af_vsock: refactor transport lookup code

2024-07-10 Thread Amery Hung
From: Bobby Eshleman Introduce new reusable function vsock_connectible_lookup_transport() that performs the transport lookup logic. No functional change intended. Reviewed-by: Stefano Garzarella Signed-off-by: Bobby Eshleman --- net/vmw_vsock/af_vsock.c | 25 ++--- 1 file

[RFC PATCH net-next v6 01/14] af_vsock: generalize vsock_dgram_recvmsg() to all transports

2024-07-10 Thread Amery Hung
From: Bobby Eshleman This commit drops the transport->dgram_dequeue callback and makes vsock_dgram_recvmsg() generic to all transports. To make this possible, two transport-level changes are introduced: - transport in the receiving path now stores the cid and port into the control buffer of an

[RFC PATCH net-next v6 00/14] virtio/vsock: support datagrams

2024-07-10 Thread Amery Hung
Hey all! This series introduces support for datagrams to virtio/vsock. It is a spin-off (and smaller version) of this series from the summer: https://lore.kernel.org/all/cover.1660362668.git.bobby.eshle...@bytedance.com/ Please note that this is an RFC and should not be merged until associated