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

2025-02-10 Thread leonardi
Like for the other patch, some maintainers have not been CCd. On Fri, Feb 07, 2025 at 01:20:33PM +0800, Junnan Wu wrote: From: Ying Gao If suspend is executed during vsock communication and the socket is reset, the original socket will be unusable after resume. Judge the value of vdev->priv i

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

2025-02-10 Thread Luigi Leonardi
Hi Junnan, Ying Thank you for the contribution! A few minor comments on the process: I think this series is missing a cover letter, not all the maintainers have been CCd, and you should add the tag net (because it's a fix) to the subject. (e.g. [PATCH net 1/2]). Here you can find some useful

Re: [PATCH net v3 0/6] vsock: Transport reassignment and error handling issues

2025-01-28 Thread Luigi Leonardi
On Tue, Jan 28, 2025 at 02:15:26PM +0100, Michal Luczaj wrote: Series deals with two issues: - socket reference count imbalance due to an unforgiving transport release (triggered by transport reassignment); - unintentional API feature, a failing connect() making the socket impossible to use for

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

2024-06-23 Thread Luigi Leonardi
Hi Paolo and Stefano, Sorry for the (super) late reply! I haven't had much time to work on it, I hope to send a v3 by the end of this month! Thanks both of you for your comments and reviews! :) > > This will add 2 atomic operations per packet, possibly on contended > > cachelines. Have you consid

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

2024-06-21 Thread Luigi Leonardi
Hi Matias, > > > I think the test can always send packets at a frequency so the worker > > > queue > > > is always empty. but maybe, this is a corner case and most of the time the > > > worker queue is not empty in a non-testing environment. > > > > I'm not sure about this, but IMHO this optimiza

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

2024-06-18 Thread Luigi Leonardi
Hi Stefano and Matias, @Stefano Thanks for your review(s)! I'll send a V2 by the end of the week. @Matias Thanks for your feedback! > I think It would be interesting to know what exactly the test does It's relatively easy: I used fio's pingpong mode. This mode is specifically for measuring the

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

2024-06-14 Thread Luigi Leonardi
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. The first one contains some code refactoring. More details and some perform

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

2024-06-14 Thread Luigi Leonardi
-- mean(1st percentile): 602.62 ns mean(overall): 1248.83 ns mean(99th percentile): 17557.33 ns Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Marco Pinna --- net/vmw_vsock/virtio_transport.c | 32 ++-- 1 file changed

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

2024-06-14 Thread Luigi Leonardi
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_transport_send_skb() function. Co-developed-by: Luigi Leonardi

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

2024-04-08 Thread Luigi Leonardi
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 3 files changed, 91

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

2024-04-08 Thread Luigi Leonardi
time the host notifies the guest that it consumed the skbuffs. In vhost-vsock (H2G) the counter is decremented after the skbuff is queued in the virtqueue. In vsock_loopback the counter is decremented after the skbuff is dequeued. Signed-off-by: Luigi Leonardi --- drivers/vhost/vsock.c

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

2024-04-08 Thread Luigi Leonardi
Meyer Signed-off-by: Luigi Leonardi --- include/net/af_vsock.h | 3 +++ net/vmw_vsock/af_vsock.c | 51 +--- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 535701efc1e5..7d67faa7bbdb 100644

[PATCH net-next v2 0/3] This patch series introduce the support for ioctl(s) in AF_VSOCK.

2024-04-08 Thread Luigi Leonardi
gestions: - vsock_do_ioctl has been rewritten - ioctl(SIOCOUTQ) test is skipped when it is not supported - Minor variable/function name changes - rebased to latest net-next Link: https://lore.kernel.org/netdev/as2p194mb2170c0fc43dda2cb637ce6b29a...@as2p194mb2170.eurp194.prod.outlook.com Luigi Leo

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

2024-04-04 Thread Luigi Leonardi
Hi Stefano, Thanks for the review. >We incremented it only for VIRTIO_VSOCK_OP_RW, should we check the >same here? Checking for the length of the skbuf or checking for VIRTIO_VSOCK_OP_RW AFAIK is equivalent. Since the only packet with payload is this one. I'll add a comment in v2 to make it more

[PATCH net-next 0/3] ioctl support for AF_VSOCK and virtio-based transports

2024-04-02 Thread Luigi Leonardi
this new feature. More details can be found in each patch changelog. Luigi Leonardi (3): vsock: add support for SIOCOUTQ ioctl for all vsock socket types. vsock/virtio: add SIOCOUTQ support for all virtio based transports test/vsock: add ioctl unsent bytes test drivers/vhost/vsock.c

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

2024-04-02 Thread Luigi Leonardi
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 | 83 3 files changed, 89

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

2024-04-02 Thread Luigi Leonardi
the host notifies the guest that it consumed the skbuffs. In vhost-vsock (H2G) the counter is decremented after the skbuff is queued in the virtqueue. In vsock-loopback the counter is decremented after the skbuff is dequeued. Signed-off-by: Luigi Leonardi --- drivers/vhost/vsock.c

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

2024-04-02 Thread Luigi Leonardi
Meyer Signed-off-by: Luigi Leonardi --- include/net/af_vsock.h | 1 + net/vmw_vsock/af_vsock.c | 42 +--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 535701efc1e5..cd4311abd3c9 100644