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

2024-07-30 Thread Amery Hung
On Tue, Jul 30, 2024 at 1:00 AM Stefano Garzarella wrote: > > On Sun, Jul 28, 2024 at 11:52:54AM GMT, Amery Hung wrote: > >On Tue, Jul 23, 2024 at 7:40 AM Stefano Garzarella > >wrote: > >> > >> On Wed, Jul 10, 2024 at 09:25:45PM GMT, Amery Hu

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

2024-07-29 Thread Amery Hung
On Tue, Jul 23, 2024 at 7:42 AM Stefano Garzarella wrote: > > On Wed, Jul 10, 2024 at 09:25:50PM GMT, Amery Hung wrote: > >From: Bobby Eshleman > > > >This commit adds the common datagram receive functionality for virtio > >transports. It does not add

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

2024-07-29 Thread Amery Hung
On Mon, Jul 29, 2024 at 1:12 PM Arseniy Krasnov wrote: > > Hi, > > > diff --git a/net/vmw_vsock/virtio_transport_common.c > > b/net/vmw_vsock/virtio_transport_common.c > > index a1c76836d798..46cd1807f8e3 100644 > > --- a/net/vmw_vsock/virtio_transport_common.c > > +++ b/net/vmw_vsock/virtio_tran

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

2024-07-28 Thread Amery Hung
On Wed, Jul 24, 2024 at 11:41 PM Arseniy Krasnov wrote: > > Hi > > +static const struct vsock_transport * > +vsock_connectible_lookup_transport(unsigned int cid, __u8 flags) > ^^^ may be just 'u8' ? > +{ > + const struct vsock_transport *

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

2024-07-28 Thread Amery Hung
On Tue, Jul 23, 2024 at 7:43 AM Stefano Garzarella wrote: > > On Wed, Jul 10, 2024 at 09:25:55PM GMT, Amery Hung wrote: > >From: Bobby Eshleman > > > >From: Jiang Wang > > > >This commit adds tests for vsock datagram. > > > >Signed-off-by: Bobby E

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

2024-07-28 Thread Amery Hung
On Sun, Jul 28, 2024 at 1:40 PM Arseniy Krasnov wrote: > > Hi Amery > > > /* Transport features flags */ > > /* Transport provides host->guest communication */ > > -#define VSOCK_TRANSPORT_F_H2G0x0001 > > +#define VSOCK_TRANSPORT_F_H2G0x0001 > > /

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

2024-07-28 Thread Amery Hung
On Tue, Jul 23, 2024 at 7:41 AM Stefano Garzarella wrote: > > On Wed, Jul 10, 2024 at 09:25:46PM GMT, Amery Hung wrote: > >From: Bobby Eshleman > > > >This commit adds support for bound dgram sockets to be tracked in a > >separate bind table from connectible soc

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

2024-07-28 Thread Amery Hung
On Tue, Jul 23, 2024 at 7:40 AM Stefano Garzarella wrote: > > On Wed, Jul 10, 2024 at 09:25:45PM GMT, Amery Hung wrote: > >From: Bobby Eshleman > > > >This commit makes the bind table management functions in vsock usable > >for different bind tables. Future work

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

2024-07-26 Thread Amery Hung
On Tue, Jul 23, 2024 at 7:42 AM Stefano Garzarella wrote: > > On Wed, Jul 10, 2024 at 09:25:48PM GMT, Amery Hung wrote: > >From: Bobby Eshleman > > > >This commit implements the common function > >virtio_transport_dgram_enqueue for enqueueing datagrams. It does no

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

2024-07-15 Thread Amery Hung
agreement between the transport and the socket layer that skb->data > > always points to the beginning of the payload (and not, for example, > > the packet header). > > > Like in the other patch, please use imperative in the commit message. > > > > Signed-off-b

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

2024-07-15 Thread Amery Hung
On Mon, Jul 15, 2024 at 1:25 AM Arseniy Krasnov wrote: > > Hi! Sorry, i was not in cc, so I'll reply in this way :) Ope. I will copy you in the next version. > > +static const struct vsock_transport * > +vsock_dgram_lookup_transport(unsigned int cid, __u8 flags) > +{ > + const struct vsock

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

2024-07-11 Thread Amery Hung
On Thu, Jul 11, 2024 at 4:03 PM Luigi Leonardi wrote: > > Hi Bobby, Amery > > Thank you for working on this! > > > This commit implements datagram support with a new version of > > ->dgram_allow(). > > Commit messages should be imperative "This commit implements X" -> > "Implements X". > https://

[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 H

[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

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

2024-07-10 Thread Amery Hung
error queue. Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung --- drivers/vhost/vsock.c| 60 ++-- net/vmw_vsock/af_vsock.c | 2 +- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c

[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
incoming packets - virtio_transport_recv_pkt() saves the source cid and port to the control buffer for recvmsg() to initialize sockaddr_vm structure when using datagram Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung --- net/vmw_vsock/virtio_transport_common.c | 79

[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

[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
a transport_{h2g,g2h}. Prior to H2G/G2H coming online, the socket layer will access the VMCI transport via "transport_dgram_fallback". Only transports with a special datagram fallback use-case such as VMCI need to register VSOCK_TRANSPORT_F_DGRAM_FALLBACK. Signed-off-by: Bobby Eshleman Si

[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
queue. That is, they must use skb_pull() before enqueuing. This is an agreement between the transport and the socket layer that skb->data always points to the beginning of the payload (and not, for example, the packet header). Signed-off-by: Bobby Eshleman Signed-off-by: Amery Hung -

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

2024-07-10 Thread Amery Hung
ff-by: Amery Hung --- Changes in v6: - allow empty transport in datagram vsock - add empty transport checks in various paths - transport layer now saves source cid and port to control buffer of skb to remove the dependency of transport in recvmsg() - fix virtio dgram_enqueue() by looking up the tran