Hi Konstantin,
On Wed, Jul 09, 2025 at 09:54:03AM -0500, Konstantin Shkolnyy wrote:
I'm seeing a problem on s390 with the new "SOCK_STREAM transport
change null-ptr-deref" test. Here is how it appears to happen:
test_stream_transport_change_client() spins for 2s and sends 70K+
CONTROL_CONTINU
TINUE);
} while (current_nsec() < tout);
-- 2.50.0
LGTM!
Thanks for the fix!
Reviewed-by: Luigi Leonardi
t is not NULL if a G2H transport is
available.
[1]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/
Suggested-by: Hyunwoo Kim
Suggested-by: Michal Luczaj
Signed-off-by: Luigi Leonardi
---
tools/testing/vsock/Makefile | 1 +
tools/testing/vsock/vsock
Add three new macros: TRANSPORTS_G2H, TRANSPORTS_H2G and
TRANSPORTS_LOCAL.
They can be used to identify the type of the transport(s) loaded when
using the `get_transports()` function.
Suggested-by: Stefano Garzarella
Signed-off-by: Luigi Leonardi
---
tools/testing/vsock/util.h | 4
1 file
org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/#t
[4]https://lore.kernel.org/netdev/2b3062e3-bdaa-4c94-a3c0-2930595b9...@rbox.co/
Signed-off-by: Luigi Leonardi
---
Changes in v5:
- Addressed Stefano's comments:
- Use a macro for G2H transport detection
- Improved commits an
Hi Stefano,
On Wed, Jun 25, 2025 at 10:26:26AM +0200, Stefano Garzarella wrote:
On Tue, Jun 24, 2025 at 05:40:15PM +0200, Luigi Leonardi wrote:
Add a new test to ensure that when the transport changes a null pointer
dereference does not occur. The bug was reported upstream [1] and fixed
with
hal Luczaj
Signed-off-by: Luigi Leonardi
---
This series introduces a new test that checks for a null pointer
dereference that may happen when there is a transport change[1]. This
bug was fixed in [2].
Note that this test *cannot* fail, it hangs if it triggers a kernel
oops. The intended use-
Hi Stefano,
On Wed, Jun 11, 2025 at 04:53:11PM +0200, Stefano Garzarella wrote:
On Wed, Jun 11, 2025 at 04:07:25PM +0200, Luigi Leonardi wrote:
Add a new test to ensure that when the transport changes a null pointer
dereference does not occur. The bug was reported upstream [1] and fixed
with
On Mon, Jun 16, 2025 at 03:42:53PM +0200, Luigi Leonardi wrote:
On Fri, Jun 13, 2025 at 11:11:50AM +0800, Xuewei Niu wrote:
This patch adds support for SIOCINQ ioctl, which returns the number of
bytes unread in the socket.
Signed-off-by: Xuewei Niu
---
include/net/af_vsock.h | 2 ++
net
+ }
case SIOCOUTQ: {
ssize_t n_bytes;
--
2.34.1
Reviewed-by: Luigi Leonardi
nst *errmsg);
void enable_so_zerocopy_check(int fd);
void enable_so_linger(int fd, int timeout);
+int get_transports(void);
#endif /* UTIL_H */
--
2.49.0
Checked the code and tested `get_transports()`. It works as expected!
I'm not sure about the `checkpatch.pl` errors, but code LGTM to me.
Tested-by: Luigi Leonardi
Reviewed-by: Luigi Leonardi
Thanks!
Luigi
nt cid, unsigned int port);
+int vsock_bind_try(unsigned int cid, unsigned int port, int type);
int vsock_bind(unsigned int cid, unsigned int port, int type);
int vsock_bind_connect(unsigned int cid, unsigned int port,
unsigned int bind_port, int type);
--
2.49.0
Reviewed-by: Luigi Leonardi
hal Luczaj
Signed-off-by: Luigi Leonardi
---
This series introduces a new test that checks for a null pointer
dereference that may happen when there is a transport change[1]. This
bug was fixed in [2].
Note that this test *cannot* fail, it hangs if it triggers a kernel
oops. The intended use-
Hi Michal,
On Mon, Apr 21, 2025 at 11:50:41PM +0200, Michal Luczaj wrote:
Currently vsock's lingering effectively boils down to waiting (or timing
out) until packets are consumed or dropped by the peer; be it by receiving
the data, closing or shutting down the connection.
To align with the sema
and
immediately closes connections to stress the transport switch between
two connect() calls, where the first one was interrupted by a signal
(see Closes link).
Reported-by: Luigi Leonardi
Closes:
https://lore.kernel.org/virtualization/bq6hxrolno2vmtqwcvb5bljfpb7mvwb3kohrvaed6auz5vxrfv
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
.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
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
mutex_init(&vsock->tx_lock);
mutex_init(&vsock->rx_lock);
--
2.34.1
Reviewed-by: Luigi Leonardi
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
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
release_sock(sk);
sk_psock_put(sk, psock);
--
2.47.1
LGTM!
Reviewed-By: Luigi Leonardi
> 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:
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.
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
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
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: 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
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
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
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
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
>
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
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
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
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
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
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
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
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: 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
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
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
47 matches
Mail list logo