Re: [virtio-comment] Re: [MASSMAIL KLMS] Re: [virtio-comment] Re: [MASSMAIL KLMS] Re: [virtio-comment] [RFC PATCH v4 2/2] virtio-vsock: SOCK_SEQPACKET description

2021-04-09 Thread Stefano Garzarella
: On 30.03.2021 11:55, Stefan Hajnoczi wrote: On Tue, Mar 30, 2021 at 09:15:39AM +0300, Arseny Krasnov wrote: On 30.03.2021 00:28, Stefano Garzarella wrote: On Mon, Mar 29, 2021 at 08:33:27PM +0300, Arseny Krasnov wrote: On 29.03.2021 19:11, Stefan Hajnoczi wrote: On Fri, Mar 26, 2021 at 12:02:50PM +0300

Re: memory leak in virtio_transport_send_pkt_info

2021-03-31 Thread Stefano Garzarella
On Wed, Mar 31, 2021 at 10:04:18AM +0100, Stefan Hajnoczi wrote: On Mon, Feb 08, 2021 at 08:39:30AM -0800, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:9f29bd8b Merge tag 'fs_for_v5.11-rc5' of git://git.kernel... git tree: upstream console output:

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-31 Thread Stefano Garzarella
On Tue, Mar 30, 2021 at 06:02:33PM -0700, Jiang Wang . wrote: Hi Stefano, I checked dgram code again. I think assigning transport for each packet is doable. The dgram will be similar to stream to have two transports. Yeah, make sense. If there is no other problem, I can submit a Linux

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Stefano Garzarella
Hi Jiang, On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: Hi Michael and Stefan, I thought about this and discussed it with my colleague Cong Wang. One idea is to make current asynchronous send_pkt flow to be synchronous, then if the virtqueue is full, the function can return

Re: [virtio-comment] Re: [MASSMAIL KLMS] Re: [virtio-comment] [RFC PATCH v4 2/2] virtio-vsock: SOCK_SEQPACKET description

2021-03-30 Thread Stefano Garzarella
On Tue, Mar 30, 2021 at 09:15:39AM +0300, Arseny Krasnov wrote: On 30.03.2021 00:28, Stefano Garzarella wrote: On Mon, Mar 29, 2021 at 08:33:27PM +0300, Arseny Krasnov wrote: On 29.03.2021 19:11, Stefan Hajnoczi wrote: On Fri, Mar 26, 2021 at 12:02:50PM +0300, Arseny Krasnov wrote

Re: [virtio-comment] [RFC PATCH v4 2/2] virtio-vsock: SOCK_SEQPACKET description

2021-03-29 Thread Stefano Garzarella
ced and performance should be comparable to SOCK_STREAM. Well, my first versions of SOCK_SEQPACKET implementation, worked something like this: i used flags field of header as length of whole message. I discussed it with Stefano Garzarella, and he told that it will be better to use special "header"

Re: [PATCH v5 03/11] vhost-vdpa: protect concurrent access to vhost device iotlb

2021-03-25 Thread Stefano Garzarella
ertions(+), 1 deletion(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v7 00/22] virtio/vsock: introduce SOCK_SEQPACKET support

2021-03-25 Thread Stefano Garzarella
Hi Arseny, On Tue, Mar 23, 2021 at 04:07:13PM +0300, Arseny Krasnov wrote: This patchset implements support of SOCK_SEQPACKET for virtio transport. As SOCK_SEQPACKET guarantees to save record boundaries, so to do it, two new packet operations were added: first for start of

Re: [RFC PATCH v7 18/22] vsock/loopback: setup SEQPACKET ops for transport

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:14:33PM +0300, Arseny Krasnov wrote: This adds SEQPACKET ops for loopback transport and 'seqpacket_allow()' callback. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/vsock_loopback.c | 12 1 file changed, 12 insertions(+) Reviewed-by: Stefano

Re: [RFC PATCH v7 17/22] vhost/vsock: setup SEQPACKET ops for transport

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:14:18PM +0300, Arseny Krasnov wrote: This also removes ignore of non-stream type of packets and adds 'seqpacket_allow()' callback. Signed-off-by: Arseny Krasnov --- drivers/vhost/vsock.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) Same

Re: [RFC PATCH v7 16/22] virtio/vsock: setup SEQPACKET ops for transport

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:14:03PM +0300, Arseny Krasnov wrote: This adds SEQPACKET ops for virtio transport and 'seqpacket_allow()' callback. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport.c | 12 1 file changed, 12 insertions(+) Sorry for not mentioning this

Re: [RFC PATCH v7 15/22] virtio/vsock: SEQPACKET support feature bit

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:13:49PM +0300, Arseny Krasnov wrote: This adds new virtio vsock specific feature bit which means SOCK_SEQPACKET support. Guest negotiates this bit with vhost, thus checking that vhost side supports SEQPACKET. Signed-off-by: Arseny Krasnov ---

Re: [RFC PATCH v7 14/22] virtio/vsock: rest of SOCK_SEQPACKET support

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:13:29PM +0300, Arseny Krasnov wrote: This adds rest of logic for SEQPACKET: 1) SEQPACKET specific functions which send SEQ_BEGIN/SEQ_END. Note that both functions may sleep to wait enough space for SEQPACKET header. 2) SEQ_BEGIN/SEQ_END in TAP packet capture. 3)

Re: [RFC PATCH v7 13/22] virtio/vsock: add SEQPACKET receive logic

2021-03-25 Thread Stefano Garzarella
64 + 1 file changed, 45 insertions(+), 19 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v7 12/22] virtio/vsock: fetch length for SEQPACKET record

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:12:55PM +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 --- v6 -> v7: 1) Now

Re: [RFC PATCH v7 11/22] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:12:41PM +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 v7 06/22] af_vsock: implement send logic for SEQPACKET

2021-03-25 Thread Stefano Garzarella
17 insertions(+), 6 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v7 05/22] af_vsock: separate wait space loop

2021-03-25 Thread Stefano Garzarella
deletions(-) I had already reviewed this one as well and it doesn't seem to have changed :-) Reviewed-by: Stefano Garzarella diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 74ac8a4c4168..7232f6c42a36 100644 --- a/include/net/af_vsock.h +++ b/include/net/af_vsock.h

Re: [RFC PATCH v7 04/22] af_vsock: implement SEQPACKET receive loop

2021-03-25 Thread Stefano Garzarella
On Tue, Mar 23, 2021 at 04:10:03PM +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 v7 03/22] af_vsock: separate receive data loop

2021-03-25 Thread Stefano Garzarella
is no longer happy. But this doesn't seem to be the case. So please keep the tags between versions :-) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 421c0303b26f..0bc661e54262 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock

Re: [PATCH] vhost: Fix vhost_vq_reset()

2021-03-17 Thread Stefano Garzarella
viewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [virtio-comment] Re: [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 09:50:48AM -0400, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 11:16:54AM +0100, Stefano Garzarella wrote: On Thu, Feb 18, 2021 at 09:07:12AM +0300, Arseny Krasnov wrote: > This patchset adds description of SOCK_SEQPACKET socket's type > of virtio vsock. &g

Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 06:35:11AM +0300, Arseny Krasnov wrote: On 15.03.2021 18:53, Cornelia Huck wrote: On Mon, 15 Mar 2021 11:35:41 +0300 Arseny Krasnov wrote: This replaces constants defined in "bit X set to Y" manner with enums from Linux kernel uapi headers. --- virtio-vsock.tex | 29

Re: [RFC PATCH v6 00/22] virtio/vsock: introduce SOCK_SEQPACKET support

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 06:37:31AM +0300, Arseny Krasnov wrote: On 15.03.2021 18:22, Arseny Krasnov wrote: On 15.03.2021 14:40, Stefano Garzarella wrote: Hi Arseny, On Sun, Mar 07, 2021 at 08:57:19PM +0300, Arseny Krasnov wrote: This patchset implements support of SOCK_SEQPACKET

Re: [PATCH v4 06/14] vringh: add vringh_kiov_length() helper

2021-03-15 Thread Stefano Garzarella
On Mon, Mar 15, 2021 at 05:51:30PM +0100, Laurent Vivier wrote: On 15/03/2021 17:34, Stefano Garzarella wrote: This new helper returns the total number of bytes covered by a vringh_kiov. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- include/linux

[PATCH v4 14/14] vdpa_sim_blk: add support for vdpa management tool

2021-03-15 Thread Stefano Garzarella
"vendor_id": 0, "max_vqs": 1, "max_vq_size": 256 } } } # Delete the vDPA device after its use $ vdpa dev del blk0 Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_s

[PATCH v4 13/14] vdpa_sim_blk: handle VIRTIO_BLK_T_GET_ID

2021-03-15 Thread Stefano Garzarella
Handle VIRTIO_BLK_T_GET_ID request, always answering the "vdpa_blk_sim" string. Acked-by: Jason Wang Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- v2: - made 'vdpasim_blk_id' static [Jason] --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 15 +++ 1 file c

[PATCH v4 12/14] vdpa_sim_blk: implement ramdisk behaviour

2021-03-15 Thread Stefano Garzarella
The previous implementation wrote only the status of each request. This patch implements a more accurate block device simulator, providing a ramdisk-like behavior and adding input validation. Acked-by: Jason Wang Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- v2: - used %zd

[PATCH v4 11/14] vdpa: add vdpa simulator for block device

2021-03-15 Thread Stefano Garzarella
commits. Signed-off-by: Max Gurtovoy [sgarzare: various cleanups/fixes] Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- v4: - include linux/blkdev.h to fix a build issue - fix vdpa_register_device() passing the new 'nvqs' params v3: - updated Mellanox copyright to NVIDIA [Max

[PATCH v4 09/14] vhost/vdpa: use get_config_size callback in vhost_vdpa_config_validate()

2021-03-15 Thread Stefano Garzarella
Let's use the new 'get_config_size()' callback available instead of using the 'virtio_id' to get the size of the device config space. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vdpa.c b

[PATCH v4 10/14] vhost/vdpa: Remove the restriction that only supports virtio-net devices

2021-03-15 Thread Stefano Garzarella
-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 7ae4080e57d8..850ed4b62942 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -16,12 +16,12 @@ #include #include

[PATCH v4 08/14] vdpa: add get_config_size callback in vdpa_config_ops

2021-03-15 Thread Stefano Garzarella
This new callback is used to get the size of the configuration space of vDPA devices. Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 4 drivers/vdpa/ifcvf/ifcvf_main.c | 6 ++ drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 ++ drivers/vdpa/vdpa_sim/vdpa_sim.c

[PATCH v4 07/14] vdpa_sim: cleanup kiovs in vdpasim_free()

2021-03-15 Thread Stefano Garzarella
a request, but we should call it when we free the entire device. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index

[PATCH v4 06/14] vringh: add vringh_kiov_length() helper

2021-03-15 Thread Stefano Garzarella
This new helper returns the total number of bytes covered by a vringh_kiov. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- include/linux/vringh.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/vringh.h b/include/linux

[PATCH v4 05/14] vringh: implement vringh_kiov_advance()

2021-03-15 Thread Stefano Garzarella
In some cases, it may be useful to provide a way to skip a number of bytes in a vringh_kiov. Let's implement vringh_kiov_advance() for this purpose, reusing the code from vringh_iov_xfer(). We replace that code calling the new vringh_kiov_advance(). Acked-by: Jason Wang Signed-off-by: Stefano

[PATCH v4 04/14] vringh: explain more about cleaning riov and wiov

2021-03-15 Thread Stefano Garzarella
riov and wiov can be reused with subsequent calls of vringh_getdesc_*(). Let's add a paragraph in the documentation of these functions to better explain when riov and wiov need to be cleaned up. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vhost/vringh.c | 15

[PATCH v4 03/14] vringh: reset kiov 'consumed' field in __vringh_iov()

2021-03-15 Thread Stefano Garzarella
__vringh_iov() overwrites the contents of riov and wiov, in fact it resets the 'i' and 'used' fields, but also the 'consumed' field should be reset to avoid an inconsistent state. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vhost/vringh.c | 4 ++-- 1 file changed, 2

[PATCH v4 02/14] vringh: add 'iotlb_lock' to synchronize iotlb accesses

2021-03-15 Thread Stefano Garzarella
-by: Stefano Garzarella --- include/linux/vringh.h | 6 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- drivers/vhost/vringh.c | 9 - 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/linux/vringh.h b/include/linux/vringh.h index 59bd50f99291

[PATCH v4 01/14] vdpa_sim: use iova module to allocate IOVA addresses

2021-03-15 Thread Stefano Garzarella
, vdpasim_map_range() and vdpasim_unmap_range(), to handle the IOVA allocation and the registration into the IOMMU/IOTLB. These functions are used by dma_map_ops callbacks. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- v2: - used ULONG_MAX instead of ~0UL [Jason] - fixed typos in comment

[PATCH v4 00/14] vdpa: add vdpa simulator for block device

2021-03-15 Thread Stefano Garzarella
nfig_size() callback to allow any device in vhost-vdpa. The series also includes small fixes for vringh, vdpa, and vdpa_sim that I discovered while implementing and testing the block simulator. Thanks for your feedback, Stefano Max Gurtovoy (1): vdpa: add vdpa simulator for block device St

Re: [RFC PATCH v6 00/22] virtio/vsock: introduce SOCK_SEQPACKET support

2021-03-15 Thread Stefano Garzarella
Hi Arseny, On Sun, Mar 07, 2021 at 08:57:19PM +0300, Arseny Krasnov wrote: This patchset implements support of SOCK_SEQPACKET for virtio transport. As SOCK_SEQPACKET guarantees to save record boundaries, so to do it, two new packet operations were added: first for start of

Re: [RFC PATCH v6 17/22] virtio/vsock: SEQPACKET feature bit support

2021-03-15 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:04:01PM +0300, Arseny Krasnov wrote: This adds handling of SEQPACKET bit: guest tries to negotiate it with vhost. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport.c | 5 + 1 file changed, 5 insertions(+) Also for this patch I think is better to

Re: [RFC PATCH v6 16/22] vhost/vsock: SEQPACKET feature bit support

2021-03-15 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:03:41PM +0300, Arseny Krasnov wrote: This adds handling of SEQPACKET bit: if guest sets features with this bit cleared, then SOCK_SEQPACKET support will be disabled. Signed-off-by: Arseny Krasnov --- drivers/vhost/vsock.c | 6 +- 1 file changed, 5 insertions(+), 1

Re: [RFC PATCH v6 14/22] virtio/vsock: rest of SOCK_SEQPACKET support

2021-03-15 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:03:09PM +0300, Arseny Krasnov wrote: This adds rest of logic for SEQPACKET: 1) SEQPACKET specific functions which send SEQ_BEGIN/SEQ_END. Note that both functions may sleep to wait enough space for SEQPACKET header. 2) SEQ_BEGIN/SEQ_END in TAP packet capture. 3)

Re: [RFC PATCH v6 13/22] virtio/vsock: add SEQPACKET receive logic

2021-03-15 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:02:50PM +0300, Arseny Krasnov wrote: This modifies current receive logic for SEQPACKET support: 1) Inserts 'SEQ_BEGIN' packet to socket's rx queue. 2) Inserts 'RW' packet to socket's rx queue, but without merging with buffer of last packet in queue. 3) Performs check

Re: [RFC PATCH v6 11/22] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-03-15 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:02:01PM +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 v6 10/22] virtio/vsock: simplify credit update function API

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:01:44PM +0300, Arseny Krasnov wrote: This function is static and 'hdr' arg was always NULL. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport_common.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Stefano Garzarella

Re: [RFC PATCH v6 09/22] virtio/vsock: set packet's type in virtio_transport_send_pkt_info()

2021-03-12 Thread Stefano Garzarella
, set it directly in 'virtio_transport_send_ pkt_info()', so callers don't need to set it. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport_common.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) Reviewed-by: Stefano Garzarella

Re: [RFC PATCH v6 08/22] af_vsock: update comments for stream sockets

2021-03-12 Thread Stefano Garzarella
(+), 14 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v6 07/22] af_vsock: rest of SEQPACKET support

2021-03-12 Thread Stefano Garzarella
+++- 2 files changed, 36 insertions(+), 1 deletion(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v6 12/22] virtio/vsock: fetch length for SEQPACKET record

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:02:31PM +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 v6 04/22] af_vsock: implement SEQPACKET receive loop

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 08:59:45PM +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 v6 06/22] af_vsock: implement send logic for SEQPACKET

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:00:26PM +0300, Arseny Krasnov wrote: This adds some logic to current stream enqueue function for SEQPACKET support: 1) Use transport's seqpacket enqueue callback. 2) Return value from enqueue function is whole record length or error for SOCK_SEQPACKET.

Re: [RFC PATCH v6 04/22] af_vsock: implement SEQPACKET receive loop

2021-03-12 Thread Stefano Garzarella
-by: Arseny Krasnov --- include/net/af_vsock.h | 5 +++ net/vmw_vsock/af_vsock.c | 95 +++- 2 files changed, 99 insertions(+), 1 deletion(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization

Re: [RFC PATCH v6 02/22] af_vsock: separate wait data loop

2021-03-12 Thread Stefano Garzarella
/af_vsock.c | 156 +-- 1 file changed, 84 insertions(+), 72 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman

Re: [RFC PATCH v6 01/22] af_vsock: update functions for connectible socket

2021-03-12 Thread Stefano Garzarella
Krasnov --- net/vmw_vsock/af_vsock.c | 64 +--- 1 file changed, 34 insertions(+), 30 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https

[PATCH 1/2] vhost-vdpa: fix use-after-free of v->config_ctx

2021-03-11 Thread Stefano Garzarella
g interrupt in vdpa") Cc: lingshan@intel.com Cc: sta...@vger.kernel.org Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index ef688c8c0e0e..00796e4ecfdf 100644 ---

[PATCH 2/2] vhost-vdpa: set v->config_ctx to NULL if eventfd_ctx_fdget() fails

2021-03-11 Thread Stefano Garzarella
ctions such as vhost_vdpa_config_put(). Fixes: 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa") Cc: lingshan@intel.com Cc: sta...@vger.kernel.org Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/driver

[PATCH 0/2] vhost-vdpa: fix issues around v->config_ctx handling

2021-03-11 Thread Stefano Garzarella
this Rust library [2] ? Could we put it in the kernel tree in tool/testing? Thanks, Stefano [1] https://github.com/stefano-garzarella/vhost/tree/vdpa [2] https://github.com/rust-vmm/vhost Stefano Garzarella (2): vhost-vdpa: fix use-after-free of v->config_ctx vhost-vdpa: set v->conf

Re: [RFC PATCH v6 00/22] virtio/vsock: introduce SOCK_SEQPACKET support

2021-03-10 Thread Stefano Garzarella
Hi Arseny, thanks for this new version. It's a busy week for me, but I hope to review this series by the end of this week :-) Thanks, Stefano On Sun, Mar 07, 2021 at 08:57:19PM +0300, Arseny Krasnov wrote: This patchset implements support of SOCK_SEQPACKET for virtio transport.

Re: [RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops

2021-03-05 Thread Stefano Garzarella
On Thu, Mar 04, 2021 at 04:34:52PM +0800, Jason Wang wrote: On 2021/3/2 10:15 下午, Stefano Garzarella wrote: On Tue, Mar 02, 2021 at 12:14:13PM +0800, Jason Wang wrote: On 2021/2/16 5:44 下午, Stefano Garzarella wrote: This new callback is used to get the size of the configuration space

Re: [RFC PATCH 10/10] vhost/vdpa: return configuration bytes read and written to user space

2021-03-05 Thread Stefano Garzarella
On Thu, Mar 04, 2021 at 04:31:22PM +0800, Jason Wang wrote: On 2021/3/2 10:06 下午, Stefano Garzarella wrote: On Tue, Mar 02, 2021 at 12:05:35PM +0800, Jason Wang wrote: On 2021/2/16 5:44 下午, Stefano Garzarella wrote: vdpa_get_config() and vdpa_set_config() now return the amount of bytes read

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-03 Thread Stefano Garzarella
On Wed, Mar 03, 2021 at 01:08:43PM +0100, Cornelia Huck wrote: On Wed, 24 Feb 2021 10:32:00 +0100 Stefano Garzarella wrote: On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: >Signed-off-by: Arseny Krasnov >--- > virtio-vsock.tex | 40 +++

Re: [RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops

2021-03-02 Thread Stefano Garzarella
On Tue, Mar 02, 2021 at 12:14:13PM +0800, Jason Wang wrote: On 2021/2/16 5:44 下午, Stefano Garzarella wrote: This new callback is used to get the size of the configuration space of vDPA devices. Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 4 drivers/vdpa

Re: [RFC PATCH 10/10] vhost/vdpa: return configuration bytes read and written to user space

2021-03-02 Thread Stefano Garzarella
On Tue, Mar 02, 2021 at 12:05:35PM +0800, Jason Wang wrote: On 2021/2/16 5:44 下午, Stefano Garzarella wrote: vdpa_get_config() and vdpa_set_config() now return the amount of bytes read and written, so let's return them to the user space. We also modify vhost_vdpa_config_validate() to return 0

Re: [RFC PATCH 00/10] vdpa: get/set_config() rework

2021-03-01 Thread Stefano Garzarella
nice ping :-) On Tue, Feb 16, 2021 at 10:44:44AM +0100, Stefano Garzarella wrote: Following the discussion with Michael and Jason [1], I reworked a bit get/set_config() in vdpa. I changed vdpa_get_config() to check the boundaries and added vdpa_set_config(). When 'offset' or 'len' parameters

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-02-24 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: Signed-off-by: Arseny Krasnov --- virtio-vsock.tex | 40 +--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/virtio-vsock.tex b/virtio-vsock.tex index da7e641..1ee8f99 100644 ---

Re: [RFC PATCH v5 00/19] virtio/vsock: introduce SOCK_SEQPACKET support

2021-02-24 Thread Stefano Garzarella
On Wed, Feb 24, 2021 at 11:28:50AM +0300, Arseny Krasnov wrote: On 24.02.2021 11:23, Stefano Garzarella wrote: On Wed, Feb 24, 2021 at 07:29:25AM +0300, Arseny Krasnov wrote: On 23.02.2021 17:50, Stefano Garzarella wrote: On Mon, Feb 22, 2021 at 03:23:11PM +0100, Stefano Garzarella wrote

Re: [RFC PATCH v5 11/19] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-02-24 Thread Stefano Garzarella
On Wed, Feb 24, 2021 at 01:41:56AM -0500, Michael S. Tsirkin wrote: On Wed, Feb 24, 2021 at 08:07:48AM +0300, Arseny Krasnov wrote: On 23.02.2021 17:17, Michael S. Tsirkin wrote: > On Thu, Feb 18, 2021 at 08:39:37AM +0300, Arseny Krasnov wrote: >> This adds transport callback and it's logic

Re: [RFC PATCH v5 00/19] virtio/vsock: introduce SOCK_SEQPACKET support

2021-02-24 Thread Stefano Garzarella
On Wed, Feb 24, 2021 at 07:29:25AM +0300, Arseny Krasnov wrote: On 23.02.2021 17:50, Stefano Garzarella wrote: On Mon, Feb 22, 2021 at 03:23:11PM +0100, Stefano Garzarella wrote: Hi Arseny, On Thu, Feb 18, 2021 at 08:33:44AM +0300, Arseny Krasnov wrote: This patchset impelements

Re: [RFC PATCH v5 00/19] virtio/vsock: introduce SOCK_SEQPACKET support

2021-02-23 Thread Stefano Garzarella
On Mon, Feb 22, 2021 at 03:23:11PM +0100, Stefano Garzarella wrote: Hi Arseny, On Thu, Feb 18, 2021 at 08:33:44AM +0300, Arseny Krasnov wrote: This patchset impelements support of SOCK_SEQPACKET for virtio transport. As SOCK_SEQPACKET guarantees to save record boundaries, so

Re: [RFC PATCH v5 11/19] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-02-23 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 08:39:37AM +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 v5 10/19] virtio/vsock: simplify credit update function API

2021-02-23 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 08:39:23AM +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. Signed-off-by: Arseny Krasnov

Re: [RFC PATCH v5 09/19] virtio/vsock: set packet's type in send

2021-02-23 Thread Stefano Garzarella
The title is a little cryptic, maybe a something like: virtio/vsock: set packet's type in virtio_transport_send_pkt_info() On Thu, Feb 18, 2021 at 08:39:02AM +0300, Arseny Krasnov wrote: This moves passing type of packet from 'info' srtucture to send Also here replace send with the function

Re: [PATCH V4 3/3] vdpa: introduce virtio pci driver

2021-02-23 Thread Stefano Garzarella
insertions(+) create mode 100644 drivers/vdpa/virtio_pci/Makefile create mode 100644 drivers/vdpa/virtio_pci/vp_vdpa.c Acked-by: Stefano Garzarella diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig index ffd1e098bfd2..a245809c99d0 100644 --- a/drivers/vdpa/Kconfig +++ b/drivers/vdpa/Kconfig

Re: [PATCH] virtio: remove export for virtio_config_{enable, disable}

2021-02-22 Thread Stefano Garzarella
-- 2 files changed, 2 insertions(+), 6 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 42e09cc..4b15c00 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -141,15 +141,14 @@ void virtio_config_changed(struct

Re: [RFC PATCH v5 00/19] virtio/vsock: introduce SOCK_SEQPACKET support

2021-02-22 Thread Stefano Garzarella
Hi Arseny, On Thu, Feb 18, 2021 at 08:33:44AM +0300, Arseny Krasnov wrote: This patchset impelements support of SOCK_SEQPACKET for virtio transport. As SOCK_SEQPACKET guarantees to save record boundaries, so to do it, two new packet operations were added: first for start of

Re: [RFC PATCH v5 08/19] af_vsock: update comments for stream sockets

2021-02-22 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 08:38:48AM +0300, Arseny Krasnov wrote: This replaces 'stream' to 'connect oriented' in comments as SEQPACKET is ^ connection You forgot to update the commit message :-) With that fixed: Reviewed-by: Stefano Garzarella also connect

Re: [RFC PATCH v5 07/19] af_vsock: rest of SEQPACKET support

2021-02-22 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 08:38:28AM +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 | 36 +++-

Re: [RFC PATCH v5 05/19] af_vsock: separate wait space loop

2021-02-22 Thread Stefano Garzarella
- } - } - remove_wait_queue(sk_sleep(sk), ); + if (vsock_wait_space(sk, 1, msg->msg_flags, _data)) + goto out_err; /* These checks occur both as part of and a

Re: [RFC PATCH v5 04/19] af_vsock: implement SEQPACKET receive loop

2021-02-22 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 08:37:15AM +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 v5 03/19] af_vsock: separate receive data loop

2021-02-22 Thread Stefano Garzarella
-by: Stefano Garzarella Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 116 ++- 1 file changed, 67 insertions(+), 49 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 6cf7bb977aa1..d277dc1cdbdf 100644 --- a/net

Re: [RFC PATCH v5 02/19] af_vsock: separate wait data loop

2021-02-22 Thread Stefano Garzarella
around, let's update an old comment. Whit that fixed: Reviewed-by: Stefano Garzarella Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 155 +-- 1 file changed, 83 insertions(+), 72 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c b/net

Re: [RFC PATCH v5 01/19] af_vsock: update functions for connectible socket

2021-02-22 Thread Stefano Garzarella
On Mon, Feb 22, 2021 at 01:58:11PM +0300, Arseny Krasnov wrote: On 22.02.2021 13:50, Stefano Garzarella wrote: On Thu, Feb 18, 2021 at 08:36:03AM +0300, Arseny Krasnov wrote: This prepares af_vsock.c for SEQPACKET support: some functions such as setsockopt(), getsockopt(), connect(), recvmsg

Re: [RFC PATCH v5 01/19] af_vsock: update functions for connectible socket

2021-02-22 Thread Stefano Garzarella
Krasnov --- net/vmw_vsock/af_vsock.c | 64 +--- 1 file changed, 34 insertions(+), 30 deletions(-) IIRC I had already given my R-b to this patch. Please carry it over when you post a new version. Reviewed-by: Stefano Garzarella Thanks, Stefano diff --git

Re: [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description

2021-02-22 Thread Stefano Garzarella
On Thu, Feb 18, 2021 at 09:07:12AM +0300, Arseny Krasnov wrote: This patchset adds description of SOCK_SEQPACKET socket's type of virtio vsock. Here is implementation: https://lkml.org/lkml/2021/2/18/24 Arseny Krasnov(1): virtio-vsock: add SOCK_SEQPACKET description virtio-vsock.tex | 40

Re: [PATCH V4 2/2] vdpa: introduce virtio pci driver

2021-02-22 Thread Stefano Garzarella
On Sat, Feb 20, 2021 at 04:46:29PM +0800, Jason Wang wrote: This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for features prototyping and testing. Note that get/restore virtqueue state is not supported which

Re: [PATCH V4 1/2] vdpa: set the virtqueue num during register

2021-02-22 Thread Stefano Garzarella
deletions(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index 7c8bbfcf6c3e..d555a6a5d1ba 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -431,8 +431,7 @@ static int ifcvf_probe(struct pci_dev

Re: [PATCH for 5.10 v2 0/5] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-17 Thread Stefano Garzarella
On Wed, Feb 17, 2021 at 11:58:53AM +0100, Greg KH wrote: On Tue, Feb 16, 2021 at 03:24:34PM +0100, Stefano Garzarella wrote: v1: https://lore.kernel.org/stable/20210211162519.215418-1-sgarz...@redhat.com/ v2: - backport the upstream patch and related patches needed Commit 65b709586e22

Re: [PATCH linux-next v2] vdpa: Fix memory leak in error unwinding path

2021-02-17 Thread Stefano Garzarella
_portid, info->snd_seq, 0, info->extack); if (!err) err = genlmsg_reply(msg, info); +mdev_err: put_device(dev); +err: mutex_unlock(_dev_mutex); - if (err) nlmsg_free(msg); return err; -- 2.2

[PATCH for 5.10 v2 4/5] vdpa_sim: make 'config' generic and usable for any device type

2021-02-16 Thread Stefano Garzarella
commit f37cbbc65178e0a45823d281d290c4c02da9631c upstream. Add new 'config_size' attribute in 'vdpasim_dev_attr' and allocates 'config' dynamically to support any device types. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20201215144256.155342-12-sgarz

[PATCH for 5.10 v2 5/5] vdpa_sim: add get_config callback in vdpasim_dev_attr

2021-02-16 Thread Stefano Garzarella
() in the new vdpasim_net_get_config() callback. This is safe since in vdpa_get_config() we already check that .set_features() callback is called before .get_config(). Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20201215144256.155342-13-sgarz...@redhat.com Signed-off-by: Michael S

[PATCH for 5.10 v2 1/5] vdpa_sim: remove hard-coded virtq count

2021-02-16 Thread Stefano Garzarella
-by: Stefano Garzarella Link: https://lore.kernel.org/r/20201215144256.155342-4-sgarz...@redhat.com Signed-off-by: Michael S. Tsirkin Cc: # 5.10.x Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff

[PATCH for 5.10 v2 3/5] vdpa_sim: store parsed MAC address in a buffer

2021-02-16 Thread Stefano Garzarella
commit cf1a3b35382c10ce315c32bd2b3d7789897fbe13 upstream. As preparation for the next patches, we store the MAC address, parsed during the vdpasim_create(), in a buffer that will be used to fill 'config' together with other configurations. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella

[PATCH for 5.10 v2 2/5] vdpa_sim: add struct vdpasim_dev_attr for device attributes

2021-02-16 Thread Stefano Garzarella
in the vdpasim_dev_attr parameter. Co-developed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy Acked-by: Jason Wang Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20201215144256.155342-7-sgarz...@redhat.com Signed-off-by: Michael S. Tsirkin Cc: # 5.10.x Signed-off-by: Stefano Garzarella

[PATCH for 5.10 v2 0/5] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-16 Thread Stefano Garzarella
-C] 'vdpa_sim: add get_config callback in vdpasim_dev_attr' Thanks, Stefano Max Gurtovoy (1): vdpa_sim: remove hard-coded virtq count Stefano Garzarella (4): vdpa_sim: add struct vdpasim_dev_attr for device attributes vdpa_sim: store parsed MAC address in a buffer vdpa_sim: make 'co

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

2021-02-16 Thread Stefano Garzarella
On Mon, Feb 15, 2021 at 04:23:54PM +0100, Greg KH wrote: On Mon, Feb 15, 2021 at 04:03:21PM +0100, Stefano Garzarella wrote: On Mon, Feb 15, 2021 at 03:32:19PM +0100, Greg KH wrote: > On Thu, Feb 11, 2021 at 05:25:19PM +0100, Stefano Garzarella wrote: > &g

[RFC PATCH 10/10] vhost/vdpa: return configuration bytes read and written to user space

2021-02-16 Thread Stefano Garzarella
vdpa_get_config() and vdpa_set_config() now return the amount of bytes read and written, so let's return them to the user space. We also modify vhost_vdpa_config_validate() to return 0 (bytes read or written) instead of an error, when the buffer length is 0. Signed-off-by: Stefano Garzarella

[RFC PATCH 09/10] vhost/vdpa: use get_config_size callback in vhost_vdpa_config_validate()

2021-02-16 Thread Stefano Garzarella
Let's use the new 'get_config_size()' callback available instead of using the 'virtio_id' to get the size of the device config space. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vdpa.c b

[RFC PATCH 08/10] vhost/vdpa: allow user space to pass buffers bigger than config space

2021-02-16 Thread Stefano Garzarella
buffer allocated with the device config size. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index cdd8f24168b2..544f8582a42b 100644

  1   2   3   4   5   6   7   >