Re: Re: [PATCH 2/2] vsock/virtio: Don't reset the created SOCKET during s2r

2025-02-11 Thread Stefano Garzarella
requirements of the specification: "in-order, guaranteed, connection-oriented delivery". Thanks, Stefano > > > Best Wish > > - Original Message - > > Sender : Stefano Garzarella > > Date : 2025-02-11 00:52 (GMT+8) > > Title : Re: [PATCH 2/2]

Re: [PATCH 2/2] vsock/virtio: Don't reset the created SOCKET during s2r

2025-02-10 Thread Stefano Garzarella
On Mon, Feb 10, 2025 at 12:48:03PM +0100, leona...@redhat.com wrote: Like for the other patch, some maintainers have not been CCd. Yes, please use `scripts/get_maintainer.pl`. On Fri, Feb 07, 2025 at 01:20:33PM +0800, Junnan Wu wrote: From: Ying Gao If suspend is executed during vsock com

Re: [PATCH 1/2] vsock/virtio: Move rx_buf_nr and rx_buf_max_nr initialization position

2025-02-10 Thread Stefano Garzarella
On Fri, Feb 07, 2025 at 01:20:32PM +0800, Junnan Wu wrote: From: Ying Gao In function virtio_vsock_probe, it initializes the variables "rx_buf_nr" and "rx_buf_max_nr", but in function virtio_vsock_restore it doesn't. Move the initizalition position into function virtio_vsock_vqs_start. Once e

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-20 Thread Stefano Garzarella
On Thu, Dec 19, 2024 at 05:09:42PM +0100, Michal Luczaj wrote: On 12/19/24 16:12, Stefano Garzarella wrote: On Thu, 19 Dec 2024 at 16:05, Michal Luczaj wrote: On 12/19/24 15:48, Stefano Garzarella wrote: On Thu, 19 Dec 2024 at 15:36, Michal Luczaj wrote: On 12/19/24 09:19, Stefano

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-19 Thread Stefano Garzarella
On Thu, 19 Dec 2024 at 16:05, Michal Luczaj wrote: > > On 12/19/24 15:48, Stefano Garzarella wrote: > > On Thu, 19 Dec 2024 at 15:36, Michal Luczaj wrote: > >> > >> On 12/19/24 09:19, Stefano Garzarella wrote: > >>> ... > >>> I think the b

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-19 Thread Stefano Garzarella
On Thu, 19 Dec 2024 at 15:36, Michal Luczaj wrote: > > On 12/19/24 09:19, Stefano Garzarella wrote: > > ... > > I think the best thing though is to better understand how to handle > > deassign, rather than checking everywhere that it's not null, also > > bec

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-19 Thread Stefano Garzarella
On Wed, Dec 18, 2024 at 08:37:38PM -0500, Hyunwoo Kim wrote: On Thu, Dec 19, 2024 at 01:25:34AM +0100, Michal Luczaj wrote: On 12/18/24 16:51, Hyunwoo Kim wrote: > On Wed, Dec 18, 2024 at 04:31:03PM +0100, Stefano Garzarella wrote: >> On Wed, Dec 18, 2024 at 03:40:40PM +0100, Stefano G

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-18 Thread Stefano Garzarella
On Wed, Dec 18, 2024 at 03:40:40PM +0100, Stefano Garzarella wrote: On Wed, Dec 18, 2024 at 09:19:08AM -0500, Hyunwoo Kim wrote: On Wed, Dec 18, 2024 at 02:40:49PM +0100, Stefano Garzarella wrote: On Wed, Dec 18, 2024 at 07:25:07AM -0500, Hyunwoo Kim wrote: When calling connect to change the

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-18 Thread Stefano Garzarella
On Wed, Dec 18, 2024 at 09:19:08AM -0500, Hyunwoo Kim wrote: On Wed, Dec 18, 2024 at 02:40:49PM +0100, Stefano Garzarella wrote: On Wed, Dec 18, 2024 at 07:25:07AM -0500, Hyunwoo Kim wrote: > When calling connect to change the CID of a vsock, the loopback > worker for the VIRTIO_VSOCK_

Re: [PATCH] vsock/virtio: Fix null-ptr-deref in vsock_stream_has_data

2024-12-18 Thread Stefano Garzarella
On Wed, Dec 18, 2024 at 07:25:07AM -0500, Hyunwoo Kim wrote: When calling connect to change the CID of a vsock, the loopback worker for the VIRTIO_VSOCK_OP_RST command is invoked. During this process, vsock_stream_has_data() calls vsk->transport->stream_has_data(). However, a null-ptr-deref occur

Re: [PATCH net v2 0/3] virtio/vsock: Fix memory leaks

2024-11-19 Thread Stefano Garzarella
Hi Michal, On Thu, Nov 07, 2024 at 09:46:11PM +0100, Michal Luczaj wrote: Short series fixing some memory leaks that I've stumbled upon while toying with the selftests. Are these tests already upstream? I would like to add them to my suite, can you tell me how to run them? Thanks, Stefano

Re: [PATCH net 4/4] virtio/vsock: Put vsock_connected_sockets_vsk() to use

2024-11-08 Thread Stefano Garzarella
On Thu, Nov 07, 2024 at 10:04:03PM +0100, Michal Luczaj wrote: On 11/7/24 11:22, Stefano Garzarella wrote: On Wed, Nov 06, 2024 at 06:51:21PM +0100, Michal Luczaj wrote: Macro vsock_connected_sockets_vsk() has been unused since its introduction. Instead of removing it, utilise it in

Re: [PATCH net v2 2/3] vsock: Fix sk_error_queue memory leak

2024-11-08 Thread Stefano Garzarella
ndmsg+0x84/0xd0 [] __sys_sendmsg+0x47/0x80 [] do_syscall_64+0x93/0x180 [] entry_SYSCALL_64_after_hwframe+0x76/0x7e Fixes: 581512a6dc93 ("vsock/virtio: MSG_ZEROCOPY flag support") Signed-off-by: Michal Luczaj --- net/vmw_vsock/af_vsock.c | 3 +++ 1 file changed, 3 insertions(+)

Re: [PATCH net 4/4] virtio/vsock: Put vsock_connected_sockets_vsk() to use

2024-11-07 Thread Stefano Garzarella
On Wed, Nov 06, 2024 at 06:51:21PM +0100, Michal Luczaj wrote: Macro vsock_connected_sockets_vsk() has been unused since its introduction. Instead of removing it, utilise it in vsock_insert_connected() where it's been open-coded. No functional change intended. Fixes: d021c344051a ("VSOCK: Intro

Re: [PATCH net 3/4] virtio/vsock: Improve MSG_ZEROCOPY error handling

2024-11-07 Thread Stefano Garzarella
insertion(+) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index cd075f608d4f6f48f894543e5e9c966d3e5f22df..e2e6a30b759bdc6371bb0d63ee2e77c0ba148fd2 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net

Re: [PATCH net 2/4] virtio/vsock: Fix sk_error_queue memory leak

2024-11-07 Thread Stefano Garzarella
On Wed, Nov 06, 2024 at 06:51:19PM +0100, Michal Luczaj wrote: Kernel queues MSG_ZEROCOPY completion notifications on the error queue. Where they remain, until explicitly recv()ed. To prevent memory leaks, clean up the queue when the socket is destroyed. unreferenced object 0x8881028beb00 (s

Re: [PATCH net 1/4] virtio/vsock: Fix accept_queue memory leak

2024-11-07 Thread Stefano Garzarella
really closed") Signed-off-by: Michal Luczaj --- net/vmw_vsock/virtio_transport_common.c | 8 1 file changed, 8 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index ccbd2bc0d2109aea4f19

Re: How to implement message forwarding from one CID to another in vhost driver

2024-07-02 Thread Stefano Garzarella
ses vhost-vsock, that packets are discarded, but for vhost-device-vsock, we are handling them. Hope this clarify. Stefano On Wed, Jun 26, 2024 at 11:43 PM Dorjoy Chowdhury wrote: Hey Stefano, Thanks a lot for all the details. I will look into them and reach out if I need further input. Thank

Re: How to implement message forwarding from one CID to another in vhost driver

2024-07-02 Thread Stefano Garzarella
:37 PM Stefano Garzarella wrote: Hi Dorjoy, On Tue, Jun 25, 2024 at 11:44:30PM GMT, Dorjoy Chowdhury wrote: >Hey Stefano, [...] >> > >> >So the immediate plan would be to: >> > >> > 1) Build a new vhost-vsock-forward object model that connects to >> &

Re: How to implement message forwarding from one CID to another in vhost driver

2024-06-26 Thread Stefano Garzarella
3 <-> CID 2 communication using the vhost-user-vsock. CID 3 <-> CID 2 is the standard use case, right? The readme in [1] contains several examples, let me know if you need more details ;-) Is this https://github.com/stefano-garzarella/vhost-user-vsock where I would need to add su

Re: [PATCH net-next 0/2] vsock: avoid queuing on workqueue if possible

2024-06-14 Thread Stefano Garzarella
On Fri, Jun 14, 2024 at 03:55:41PM GMT, Luigi Leonardi wrote: This patch series introduces an optimization for vsock/virtio to reduce latency: When the guest sends a packet to the host, and the workqueue is empty, if there is enough space, the packet is put directly in the virtqueue. Thanks for

Re: [PATCH net-next 2/2] vsock/virtio: avoid enqueue packets when work queue is empty

2024-06-14 Thread Stefano Garzarella
On Fri, Jun 14, 2024 at 03:55:43PM GMT, Luigi Leonardi wrote: From: Marco Pinna This introduces an optimization in virtio_transport_send_pkt: when the work queue (send_pkt_queue) is empty the packet is put directly in the virtqueue reducing latency. In the following benchmark (pingpong mode) t

Re: [PATCH net-next 1/2] vsock/virtio: refactor virtio_transport_send_pkt_work

2024-06-14 Thread Stefano Garzarella
On Fri, Jun 14, 2024 at 03:55:42PM GMT, Luigi Leonardi wrote: From: Marco Pinna This is a preliminary patch to introduce an optimization to the enqueue system. All the code used to enqueue a packet into the virtqueue is removed from virtio_transport_send_pkt_work() and moved to the new virtio_

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-29 Thread Stefano Garzarella
On Wed, May 29, 2024 at 12:43:57PM GMT, Alexander Graf wrote: On 29.05.24 10:04, Stefano Garzarella wrote: On Tue, May 28, 2024 at 06:38:24PM GMT, Paolo Bonzini wrote: On Tue, May 28, 2024 at 5:53 PM Stefano Garzarella wrote: On Tue, May 28, 2024 at 05:49:32PM GMT, Paolo Bonzini wrote: On

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-29 Thread Stefano Garzarella
On Tue, May 28, 2024 at 06:38:24PM GMT, Paolo Bonzini wrote: On Tue, May 28, 2024 at 5:53 PM Stefano Garzarella wrote: On Tue, May 28, 2024 at 05:49:32PM GMT, Paolo Bonzini wrote: >On Tue, May 28, 2024 at 5:41 PM Stefano Garzarella wrote: >> >I think it's either that or im

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-28 Thread Stefano Garzarella
On Tue, May 28, 2024 at 05:49:32PM GMT, Paolo Bonzini wrote: On Tue, May 28, 2024 at 5:41 PM Stefano Garzarella wrote: >I think it's either that or implementing virtio-vsock in userspace >(https://lore.kernel.org/qemu-devel/30baeb56-64d2-4ea3-8e53-6a5c50999...@redhat.com/, >

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-28 Thread Stefano Garzarella
On Tue, May 28, 2024 at 05:19:34PM GMT, Paolo Bonzini wrote: On 5/27/24 09:54, Alexander Graf wrote: On 27.05.24 09:08, Alexander Graf wrote: Hey Stefano, On 23.05.24 10:45, Stefano Garzarella wrote: On Tue, May 21, 2024 at 08:50:22AM GMT, Alexander Graf wrote: Howdy, On 20.05.24 14:44

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-28 Thread Stefano Garzarella
On Mon, May 27, 2024 at 09:54:17AM GMT, Alexander Graf wrote: On 27.05.24 09:08, Alexander Graf wrote: Hey Stefano, On 23.05.24 10:45, Stefano Garzarella wrote: On Tue, May 21, 2024 at 08:50:22AM GMT, Alexander Graf wrote: Howdy, On 20.05.24 14:44, Dorjoy Chowdhury wrote: Hey Stefano

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-23 Thread Stefano Garzarella
On Tue, May 21, 2024 at 08:50:22AM GMT, Alexander Graf wrote: Howdy, On 20.05.24 14:44, Dorjoy Chowdhury wrote: Hey Stefano, Thanks for the reply. On Mon, May 20, 2024, 2:55 PM Stefano Garzarella wrote: Hi Dorjoy, On Sat, May 18, 2024 at 04:17:38PM GMT, Dorjoy Chowdhury wrote: Hi, Hope

Re: How to implement message forwarding from one CID to another in vhost driver

2024-05-20 Thread Stefano Garzarella
Hi Dorjoy, On Sat, May 18, 2024 at 04:17:38PM GMT, Dorjoy Chowdhury wrote: Hi, Hope you are doing well. I am working on adding AWS Nitro Enclave[1] emulation support in QEMU. Alexander Graf is mentoring me on this work. A v1 patch series has already been posted to the qemu-devel mailing list[2]

Re: [PATCH net-next v2 3/3] test/vsock: add ioctl unsent bytes test

2024-05-08 Thread Stefano Garzarella
On Mon, Apr 08, 2024 at 03:37:49PM GMT, Luigi Leonardi wrote: This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c | 85

Re: [PATCH net-next v2 1/3] vsock: add support for SIOCOUTQ ioctl for all vsock socket types.

2024-05-08 Thread Stefano Garzarella
On Mon, Apr 08, 2024 at 03:37:47PM GMT, Luigi Leonardi wrote: This add support for ioctl(s) for SOCK_STREAM SOCK_SEQPACKET and SOCK_DGRAM in AF_VSOCK. The only ioctl available is SIOCOUTQ/TIOCOUTQ, which returns the number of unsent bytes in the socket. This information is transport-specific and

Re: [PATCH net-next v2 2/3] vsock/virtio: add SIOCOUTQ support for all virtio based transports

2024-05-07 Thread Stefano Garzarella
On Thu, Apr 11, 2024 at 09:09:49AM GMT, Paolo Abeni wrote: On Mon, 2024-04-08 at 15:37 +0200, Luigi Leonardi wrote: This patch introduce support for stream_bytes_unsent and seqpacket_bytes_unsent ioctl for virtio_transport, vhost_vsock and vsock_loopback. For all transports the unsent bytes cou

Re: [PATCH net-next 3/3] test/vsock: add ioctl unsent bytes test

2024-04-03 Thread Stefano Garzarella
On Tue, Apr 02, 2024 at 05:05:39PM +0200, Luigi Leonardi wrote: This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c |

Re: [PATCH net-next 2/3] vsock/virtio: add SIOCOUTQ support for all virtio based transports

2024-04-03 Thread Stefano Garzarella
On Tue, Apr 02, 2024 at 05:05:38PM +0200, Luigi Leonardi wrote: This patch introduce support for stream_bytes_unsent in all virtio based transports: virtio-transport, vhost-vsock and vsock-loopback For all transports the unsent bytes counter is incremented in virtio_transport_send_pkt_info. In

Re: [PATCH net-next 1/3] vsock: add support for SIOCOUTQ ioctl for all vsock socket types.

2024-04-03 Thread Stefano Garzarella
On Tue, Apr 02, 2024 at 05:05:37PM +0200, Luigi Leonardi wrote: This add support for ioctl(s) for SOCK_STREAM SOCK_SEQPACKET and SOCK_DGRAM in AF_VSOCK. The only ioctl available is SIOCOUTQ/TIOCOUTQ, which returns the number of unsent bytes in the socket. This information is transport-specific an

Re: REGRESSION: RIP: 0010:skb_release_data+0xb8/0x1e0 in vhost/tun

2024-03-22 Thread Stefano Garzarella
On Fri, Mar 22, 2024 at 12:20 PM Igor Raits wrote: > > Hi Jason, > > On Fri, Mar 22, 2024 at 9:39 AM Igor Raits wrote: > > > > Hi Jason, > > > > On Fri, Mar 22, 2024 at 6:31 AM Jason Wang wrote: > > > > > > On Thu, Mar 21, 2024 at 5:44 PM Igor Raits wrote: > > > > > > > > Hello Jason & others,

[PATCH net] vsock/virtio: free queued packets when closing socket

2021-04-20 Thread Stefano Garzarella
ts during the socket release") Reported-and-tested-by: syzbot+24452624fc4c571ee...@syzkaller.appspotmail.com Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 28 + 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/net/vmw_vsock/

Re: [PATCH net] vsock/vmci: log once the failed queue pair allocation

2021-04-19 Thread Stefano Garzarella
On Fri, Apr 16, 2021 at 12:06:18PM +, Jorgen Hansen wrote: On 16 Apr 2021, at 12:44, Stefano Garzarella mailto:sgarz...@redhat.com>> wrote: VMCI feature is not supported in conjunction with the vSphere Fault Tolerance (FT) feature. VMware Tools can repeatedly try to create a

[PATCH net] vsock/vmci: log once the failed queue pair allocation

2021-04-16 Thread Stefano Garzarella
e cases, print it only once. Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Signed-off-by: Stefano Garzarella --- net/vmw_vsock/vmci_transport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c inde

Re: [PATCH V3 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-16 Thread Stefano Garzarella
: Stefano Garzarella diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index 376b2014916a..3b6f7862dbb8 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -356,7 +356,24 @@ static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev

Re: [PATCH V3 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-16 Thread Stefano Garzarella
insertions(+), 2 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h index 1c04cd256fa7..0111bfdeb342 100644 --- a/drivers/vdpa/ifcvf/ifcvf_base.h +++ b/drivers/vdpa/ifcvf/ifcvf_base.h @@ -15,6 +15,7 @@ #include #include

Re: [PATCH V2 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-15 Thread Stefano Garzarella
On Thu, Apr 15, 2021 at 05:53:36PM +0800, Zhu Lingshan wrote: get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH V2 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-15 Thread Stefano Garzarella
On Thu, Apr 15, 2021 at 05:53:35PM +0800, Zhu Lingshan wrote: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 8 +++- drivers/vdpa/ifcvf/ifcvf_main.c | 10 +- 2 files changed, 16 insertions(+),

Re: [PATCH 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-15 Thread Stefano Garzarella
On Wed, Apr 14, 2021 at 05:18:32PM +0800, Zhu Lingshan wrote: get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/i

Re: [RFC] vsock: add multiple transports support for dgram

2021-04-13 Thread Stefano Garzarella
On Tue, Apr 13, 2021 at 12:12:50PM +, Jorgen Hansen wrote: On 12 Apr 2021, at 20:53, Jiang Wang . mailto:jiang.w...@bytedance.com>> wrote: On Mon, Apr 12, 2021 at 7:04 AM Stefano Garzarella mailto:sgarz...@redhat.com>> wrote: Hi Jiang, thanks for re-starting the multi-trans

Re: [External] Re: [RFC] vsock: add multiple transports support for dgram

2021-04-12 Thread Stefano Garzarella
Hi Jiang, thanks for re-starting the multi-transport support for dgram! On Wed, Apr 07, 2021 at 11:25:36AM -0700, Jiang Wang . wrote: On Wed, Apr 7, 2021 at 2:51 AM Jorgen Hansen wrote: > On 6 Apr 2021, at 20:31, Jiang Wang wrote: > > From: "jiang.wang" > > Currently, only VMCI supports dg

Re: [PATCH] vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs fails

2021-04-12 Thread Stefano Garzarella
{ + err = -ENOMEM; goto err_map; + } err = create_direct_mr(mvdev, mr); if (err) -- 2.30.1 Reviewed-by: Stefano Garzarella

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

2021-04-12 Thread Stefano Garzarella
Hi Michael, do you think this series is in an acceptable state to be queued for the next merge window? All patches should be already acked by Jason, let me know if I need to change anything. Thanks, Stefano On Mon, Mar 15, 2021 at 05:34:36PM +0100, Stefano Garzarella wrote: v4: - added

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: https://syz

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

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 record

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-b

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 thin

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 in

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 --- include/uapi/linux/virtio

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) Sen

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

2021-03-25 Thread Stefano Garzarella
socket. net/vmw_vsock/virtio_transport_common.c | 64 + 1 file changed, 45 insertions(+), 19 deletions(-) Reviewed-by: Stefano Garzarella

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 'virtio_transport_

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, be

Re: [RFC PATCH v7 06/22] af_vsock: implement send logic for SEQPACKET

2021-03-25 Thread Stefano Garzarella
c | 21 +++-- 2 files changed, 17 insertions(+), 6 deletions(-) Reviewed-by: Stefano Garzarella

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

2021-03-25 Thread Stefano Garzarella
), 38 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/

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
the reviewer 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_vs

Re: [PATCH] vhost: Fix vhost_vq_reset()

2021-03-17 Thread Stefano Garzarella
wed-by: Stefano Garzarella

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 for

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 10/14] vhost/vdpa: Remove the restriction that only supports virtio-net devices

2021-03-15 Thread Stefano Garzarella
: 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 14/14] vdpa_sim_blk: add support for vdpa management tool

2021-03-15 Thread Stefano Garzarella
;vdpasim_blk", "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/

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

[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
n the next 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 copy

[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

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

[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: St

[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

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

2021-03-15 Thread Stefano Garzarella
ff-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 59bd50f

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

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

2021-03-15 Thread Stefano Garzarella
allow vhost-vdpa to use block devices, and I added get_config_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 G

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 record

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 mo

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) Sen

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, be

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
am type is supported, 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
anged, 17 insertions(+), 14 deletions(-) Reviewed-by: Stefano Garzarella

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

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. Signed-off-by:

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

2021-03-12 Thread Stefano Garzarella
t functions were created. Signed-off-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

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

2021-03-12 Thread Stefano Garzarella
vsock/af_vsock.c | 156 +-- 1 file changed, 84 insertions(+), 72 deletions(-) Reviewed-by: Stefano Garzarella

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

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

2021-03-11 Thread Stefano Garzarella
in other functions 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(-)

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

2021-03-11 Thread Stefano Garzarella
haps using 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-&

  1   2   3   >