[PATCH net-next v4 2/2] vsock/virtio: avoid queuing packets when intermediate queue is empty

2024-07-30 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi When the driver needs to send new packets to the device, it always queues the new sk_buffs into an intermediate queue (send_pkt_queue) and schedules a worker (send_pkt_work) to then queue them into the virtqueue exposed to the device. This increases the chance of batching, b

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

2024-07-30 Thread Luigi Leonardi via B4 Relay
From: Marco Pinna 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 Signed-of

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

2024-07-30 Thread Luigi Leonardi via B4 Relay
This series introduces an optimization for vsock/virtio to reduce latency and increase the throughput: When the guest sends a packet to the host, and the intermediate queue (send_pkt_queue) is empty, if there is enough space, the packet is put directly in the virtqueue. v3->v4 While running experi

[PATCH net-next v4 1/3] vsock: add support for SIOCOUTQ ioctl

2024-07-30 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi Add support for ioctl(s) 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 is delegated to them using a callback. Suggested-by: Daan De Meyer Signed-off-by: Luigi Le

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

2024-07-30 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET, which use SIOCOUTQ ioctl to check that the number of unsent bytes is zero after delivering a packet. vsock_connect and vsock_accept are no longer static: this is to create more generic tests, allowing code

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

2024-07-30 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi Introduce support for virtio_transport_unsent_bytes ioctl for virtio_transport, vhost_vsock and vsock_loopback. For all transports the unsent bytes counter is incremented in virtio_transport_get_credit. In virtio_transport (G2H) and in vhost-vsock (H2G) the counter is decre

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

2024-07-30 Thread Luigi Leonardi via B4 Relay
This patch series introduce the support for ioctl(s) in AF_VSOCK. The only ioctl currently available is SIOCOUTQ, which returns the number of unsent or unacked packets. It is available for SOCK_STREAM, SOCK_SEQPACKET and SOCK_DGRAM. As this information is transport-dependent, a new optional callba

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

2024-07-11 Thread Luigi Leonardi via B4 Relay
From: Marco Pinna 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 Signed-of

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

2024-07-11 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi Introduce an optimization in virtio_transport_send_pkt: when the work queue (send_pkt_queue) is empty the packet is put directly in the virtqueue increasing the throughput. In the following benchmark (pingpong mode) the host sends a payload to the guest and waits for the sam

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

2024-07-11 Thread Luigi Leonardi via B4 Relay
This series introduces an optimization for vsock/virtio to reduce latency and increase the throughput: 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. v2->v3 - Performed more experiments using iperf3 usi

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

2024-07-01 Thread Luigi Leonardi via B4 Relay
This 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. In this v2 I replaced a mutex_lock with a mutex_trylock because it was inside a R

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

2024-07-01 Thread Luigi Leonardi via B4 Relay
From: Marco Pinna Introduce 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) the host sends a payload to the guest and waits for the same payload ba

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

2024-07-01 Thread Luigi Leonardi via B4 Relay
From: Marco Pinna 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 Signed-of

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

2024-06-26 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET, which checks after a packet is delivered, that the number of unsent bytes is zero, using ioctl SIOCOUTQ. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/u

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

2024-06-26 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi 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 counter is incremented in virtio_transport_get_credit. In the virtio_transport (G2H) the counter is decrement

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

2024-06-26 Thread Luigi Leonardi via B4 Relay
From: Luigi Leonardi 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 is delegated to them using a callback. Sugges

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

2024-06-26 Thread Luigi Leonardi via B4 Relay
This patch series introduce the support for ioctl(s) in AF_VSOCK. The only ioctl currently available is SIOCOUTQ, which returns the number of unsent or unacked packets. It is available for SOCK_STREAM, SOCK_SEQPACKET and SOCK_DGRAM. As this information is transport-dependent, a new optional callba