Re: [RFC PATCH v4 07/17] af_vsock: rest of SEQPACKET support

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:16:12PM +0300, Arseny Krasnov wrote: This does rest of SOCK_SEQPACKET support: 1) Adds socket ops for SEQPACKET type. 2) Allows to create socket with SEQPACKET type. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 37 -

Re: [RFC PATCH v4 08/17] af_vsock: update comments for stream sockets

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:16:29PM +0300, Arseny Krasnov wrote: This replaces 'stream' to 'connect oriented' in comments as SEQPACKET is also connect oriented. I'm not a native speaker but maybe is better 'connection oriented' or looking at socket(2) man page 'connection-based' is also fine.

Re: [RFC PATCH v4 09/17] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:16:46PM +0300, Arseny Krasnov wrote: This adds transport callback and it's logic for SEQPACKET dequeue. Callback fetches RW packets from rx queue of socket until whole record is copied(if user's buffer is full, user is not woken up). This is done to not stall sender,

Re: [RFC PATCH v4 10/17] virtio/vsock: fetch length for SEQPACKET record

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:17:08PM +0300, Arseny Krasnov wrote: This adds transport callback which tries to fetch record begin marker from socket's rx queue. It is called from af_vsock.c before reading data packets of record. Signed-off-by: Arseny Krasnov --- include/linux/virtio_vsock.h

Re: [RFC PATCH v4 09/17] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-02-11 Thread Stefano Garzarella
On Thu, Feb 11, 2021 at 02:54:28PM +0100, Stefano Garzarella wrote: On Sun, Feb 07, 2021 at 06:16:46PM +0300, Arseny Krasnov wrote: This adds transport callback and it's logic for SEQPACKET dequeue. Callback fetches RW packets from rx queue of socket until whole record is copied(if user's

Re: [RFC PATCH v4 12/17] virtio/vsock: rest of SOCK_SEQPACKET support

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:17:44PM +0300, Arseny Krasnov wrote: This adds rest of logic for SEQPACKET: 1) Packet's type is now set in 'virtio_send_pkt_info()' using type of socket. 2) SEQPACKET specific functions which send SEQ_BEGIN/SEQ_END. Note that both functions may sleep to wait enough

Re: [RFC PATCH v4 16/17] loopback/vsock: setup SEQPACKET ops for transport

2021-02-11 Thread Stefano Garzarella
Please move this patch before the test and I'd change the prefix in "vsock_loopback" or "vsock/loopback". Thanks, Stefano On Sun, Feb 07, 2021 at 06:18:48PM +0300, Arseny Krasnov wrote: This adds SEQPACKET ops for loopback transport Signed-off-by: Arseny Krasnov ---

Re: [RFC PATCH v4 17/17] virtio/vsock: simplify credit update function API

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:19:03PM +0300, Arseny Krasnov wrote: 'virtio_transport_send_credit_update()' has some extra args: 1) 'type' may be set in 'virtio_transport_send_pkt_info()' using type of socket. 2) This function is static and 'hdr' arg was always NULL. Okay, I saw this patch

Re: [RFC PATCH v4 00/17] virtio/vsock: introduce SOCK_SEQPACKET support

2021-02-11 Thread Stefano Garzarella
Hi Arseny, On Mon, Feb 08, 2021 at 09:32:59AM +0300, Arseny Krasnov wrote: On 07.02.2021 19:20, Michael S. Tsirkin wrote: On Sun, Feb 07, 2021 at 06:12:56PM +0300, Arseny Krasnov wrote: This patchset impelements support of SOCK_SEQPACKET for virtio transport. As

Re: [PATCH netdev] virtio-net: support XDP_TX when not more queues

2021-02-11 Thread Jesper Dangaard Brouer
On Wed, 10 Feb 2021 16:40:41 -0500 "Michael S. Tsirkin" wrote: > On Wed, Jan 13, 2021 at 04:08:57PM +0800, Xuan Zhuo wrote: > > The number of queues implemented by many virtio backends is limited, > > especially some machines have a large number of CPUs. In this case, it > > is often impossible

Re: [RFC PATCH v4 03/17] af_vsock: separate receive data loop

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:15:05PM +0300, Arseny Krasnov wrote: This moves STREAM specific data receive logic to dedicated function: '__vsock_stream_recvmsg()', while checks that will be same for both types of socket are in shared function: 'vsock_connectible_recvmsg()'. Signed-off-by: Arseny

Re: [RFC PATCH v4 06/17] af_vsock: implement send logic for SEQPACKET

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:15:57PM +0300, Arseny Krasnov wrote: This adds some logic to current stream enqueue function for SEQPACKET support: 1) Send record's begin/end marker. 2) Return value from enqueue function is whole record length or error for SOCK_SEQPACKET. Signed-off-by: Arseny

Re: [RFC PATCH v4 02/17] af_vsock: separate wait data loop

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:14:48PM +0300, Arseny Krasnov wrote: This moves wait loop for data to dedicated function, because later it will be used by SEQPACKET data receive loop. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 158 +-- 1 file

Re: [RFC PATCH v4 01/17] af_vsock: update functions for connectible socket

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:14:23PM +0300, Arseny Krasnov wrote: This prepares af_vsock.c for SEQPACKET support: some functions such as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are shared between both types of sockets, so rename them in general manner. Signed-off-by: Arseny

Re: [RFC PATCH v4 04/17] af_vsock: implement SEQPACKET receive loop

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:15:22PM +0300, Arseny Krasnov wrote: This adds receive loop for SEQPACKET. It looks like receive loop for STREAM, but there is a little bit difference: 1) It doesn't call notify callbacks. 2) It doesn't care about 'SO_SNDLOWAT' and 'SO_RCVLOWAT' values, because there

Re: [RFC PATCH v4 05/17] af_vsock: separate wait space loop

2021-02-11 Thread Stefano Garzarella
On Sun, Feb 07, 2021 at 06:15:41PM +0300, Arseny Krasnov wrote: This moves loop that waits for space on send to separate function, because it will be used for SEQ_BEGIN/SEQ_END sending before and after data transmission. Waiting for SEQ_BEGIN/SEQ_END is needed because such packets carries

Re: [RFC PATCH v4 02/17] af_vsock: separate wait data loop

2021-02-11 Thread Jorgen Hansen
> On 7 Feb 2021, at 16:14, Arseny Krasnov wrote: > > This moves wait loop for data to dedicated function, because later > it will be used by SEQPACKET data receive loop. > > Signed-off-by: Arseny Krasnov > --- > net/vmw_vsock/af_vsock.c | 158 +-- > 1 file

Re: [PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

2021-02-11 Thread Stefano Garzarella
On Wed, Feb 10, 2021 at 07:12:31AM -0500, Michael S. Tsirkin wrote: On Wed, Feb 10, 2021 at 12:17:19PM +0800, Jason Wang wrote: On 2021/2/9 下午5:00, Stefano Garzarella wrote: > On Tue, Feb 09, 2021 at 07:43:02AM +0200, Eli Cohen wrote: > > On Mon, Feb 08, 2021 at 05:17:41PM +0100, Stefano

Re: [PATCH iproute2-next v5 0/5] Add vdpa device management tool

2021-02-11 Thread David Ahern
On 2/10/21 11:34 AM, Parav Pandit wrote: > Linux vdpa interface allows vdpa device management functionality. > This includes adding, removing, querying vdpa devices. > > vdpa interface also includes showing supported management devices > which support such operations. > > This patchset includes

[PATCH for 5.10] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-11 Thread Stefano Garzarella
Commit 65b709586e222fa6ffd4166ac7fdb5d5dad113ee upstream. Before this patch, if 'offset + len' was equal to sizeof(struct virtio_net_config), the entire buffer wasn't filled, returning incorrect values to the caller. Since 'vdpasim->config' type is 'struct virtio_net_config', we can safely copy

RE: [PATCH iproute2-next v5 0/5] Add vdpa device management tool

2021-02-11 Thread Parav Pandit
> From: David Ahern > Sent: Thursday, February 11, 2021 9:50 PM > > On 2/10/21 11:34 AM, Parav Pandit wrote: > > Linux vdpa interface allows vdpa device management functionality. > > This includes adding, removing, querying vdpa devices. > > > > vdpa interface also includes showing supported

Re: [RFC v2 1/7] vhost: Delete trailing dot in errpr_setg argument

2021-02-11 Thread Stefano Garzarella
On Tue, Feb 09, 2021 at 07:11:41PM +0100, Eugenio Perez Martin wrote: On Tue, Feb 9, 2021 at 5:25 PM Eric Blake wrote: On 2/9/21 9:37 AM, Eugenio Pérez wrote: > As error_setg points Incomplete sentence? Missing Signed-off-by. Sorry, I should have paid more attention. Maybe it is better

vsock virtio: questions about supporting DGRAM type

2021-02-11 Thread Jiang Wang .
Hi guys, I am working on supporting DGRAM type for virtio/vhost vsock. I already did some work and a draft code is here (which passed my tests, but still need some cleanup and only works from host to guest as of now, will add host to guest soon):