Hi all,
> + /* Inside RCU, can't sleep! */
> + ret = mutex_trylock(&vsock->tx_lock);
> + if (unlikely(ret == 0))
> + goto out_worker;
I just realized that here I don't release the tx_lock and
that the email subject is "PATCH PATCH".
I will
Hi Stefano,
Thanks for your review!
> On Thu, Jul 11, 2024 at 04:58:47PM GMT, Luigi Leonardi via B4 Relay wrote:
> >From: Luigi Leonardi
> >
> >Introduce an optimization in virtio_transport_send_pkt:
> >when the work queue (send_pkt_queue) is empty the packet is
>
Hi All,
It has been a while since the last email and this patch has not been merged yet.
This is just a gentle ping :)
Thanks,
Luigi
>Hi Michael,
>this series is marked as "Not Applicable" for the net-next tree:
>https://patchwork.kernel.org/project/netdevbpf/patch/20240730-pinna-v4-2-5c9179164.
> Link:
> https://lore.kernel.org/all/hfcr2aget2zojmqpr4uhlzvnep4vgskblx5b6xf2ddosbsrke7@nt34bxgp7j2x
> Fixes: efcd71af38be ("vsock/virtio: avoid queuing packets when intermediate
> queue is empty")
> Reported-by: Christian Brauner
> Cc: Stefano Garzarella
> Cc:
turn 0;
+
return vsk->transport->stream_has_space(vsk);
}
EXPORT_SYMBOL_GPL(vsock_stream_has_space);
--
2.47.1
Reviewed-by: Luigi Leonardi
Thanks!
Luigi
On Thu, Jan 09, 2025 at 02:34:28PM +0100, Michal Luczaj wrote:
FWIW, I've tried simplifying Hyunwoo's repro to toy with some tests.
Ended
up with
```
from threading import *
from socket import *
from signal import *
def listener(tid):
while True:
s = socket(AF_VSOCK, SO
sk->sk_state = TCP_CLOSING;
+ sk->sk_state_change(sk);
+
+ virtio_transport_cancel_close_work(vsk, cancel_timeout);
+}
+
static void virtio_transport_close_timeout(struct work_struct *work)
{
struct vsock_sock *vsk =
--
2.47.1
Thanks!
Reviewed-by: Luigi Leonardi
nt the transport unloading
--
2.47.1
Hi Stefano,
I spent some time investigating what would happen if the scheduled work
ran before `virtio_transport_cancel_close_work`. IIUC that should do no
harm and all the fields are reset correctly.
Thank you,
Luigi
Reviewed-by: Luigi Leonardi
release_sock(sk);
sk_psock_put(sk, psock);
--
2.47.1
LGTM!
Reviewed-By: Luigi Leonardi
mutex_init(&vsock->tx_lock);
mutex_init(&vsock->rx_lock);
--
2.34.1
Reviewed-by: Luigi Leonardi
within the timeout period.
If there is a G2H transport loaded in the system, the bug is not
triggered and this test will always pass.
[1]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/
Suggested-by: Michal Luczaj
Signed-off-by: Luigi Leonardi
---
tools/testing
Michal's python reproducer[3].
[1]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/
[2]https://lore.kernel.org/netdev/20250110083511.30419-1-sgarz...@redhat.com/
[3]https://lore.kernel.org/netdev/2b3062e3-bdaa-4c94-a3c0-2930595b9...@rbox.co/
Signed-off-by: Luigi Leo
Add `timeout_check_expired` function that returns true if the timeout
counter has expired.
This is useful in situations where a timeout does not necessarily mean a
failure.
Signed-off-by: Luigi Leonardi
---
tools/testing/vsock/timeout.c | 7 ++-
tools/testing/vsock/timeout.h | 3 +++
2
.run_client = test_stream_transport_change_client,
+ .run_server = test_stream_transport_change_server,
+ },
{},
};
---
base-commit: 4d872d51bc9d7b899c1f61534e3dbde72613f627
change-id: 20250306-test_vsock-3e77a9c7a245
Best regards,
--
Luigi Leonardi
Hi Michal,
On Wed, Mar 19, 2025 at 01:27:35AM +0100, Michal Luczaj wrote:
On 3/14/25 10:27, Luigi Leonardi wrote:
Add a new test to ensure that when the transport changes a null pointer
dereference does not occur[1].
Note that this test does not fail, but it may hang on the client side if
it
27;s suggestions:
- 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
Signed-off-by: Luigi Leonardi
---
Luigi Leonardi (3):
vsock: add support for SIOCOUTQ ioctl for
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
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
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
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
Before (Linux 6.8.11)
G2H 28.7 Gb/s
After
G2H 40.8 Gb/s
The performance improvement is related to this optimization,
I checked that each packet was put directly on the vq
avoiding the work queue.
Co-developed-by: Luigi Leonardi
Signed-off-by: Luigi Leonardi
Signed-off-by: Marco Pinna
---
net
ext
Signed-off-by: Luigi Leonardi
---
Marco Pinna (2):
vsock/virtio: refactor virtio_transport_send_pkt_work
vsock/virtio: avoid enqueue packets when work queue is empty
net/vmw_vsock/virtio_transport.c | 171 +--
1 file changed, 109 insertion
o: Paolo Abeni
Cc: k...@vger.kernel.org
Cc: virtualizat...@lists.linux.dev
Cc: net...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luigi Leonardi
---
Luigi Leonardi (1):
vsock/virtio: avoid queuing packets when work queue is empty
Marco Pinna (1):
v
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
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
ano's suggestions:
- 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
Signed-off-by: Luigi Leonardi
---
Luigi Leonardi (3):
vsock: add support for SIOCOUTQ ioctl
vsoc
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
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
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
all the packets go directly to the vq (Matias' suggestion)
- Used iperf3 to see if there is any improvement in overall throughput
from guest to host
- Pinned the vhost process to a pCPU.
- Run fio using 512B payload
Rebased on latest net-next
---
Luigi Leonardi (1):
vso
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
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
32 matches
Mail list logo