Skip to content

Commit 0a98de8

Browse files
stefano-garzarellaPaolo Abeni
authored andcommitted
vsock/test: fix seqpacket message bounds test
The test requires the sender (client) to send all messages before waking up the receiver (server). Since virtio-vsock had a bug and did not respect the size of the TX buffer, this test worked, but now that we are going to fix the bug, the test hangs because the sender would fill the TX buffer before waking up the receiver. Set the buffer size in the sender (client) as well, as we already do for the receiver (server). Fixes: 5c33811 ("test/vsock: rework message bounds test") Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://patch.msgid.link/20260121093628.9941-3-sgarzare@redhat.com Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 3ef3d52 commit 0a98de8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tools/testing/vsock/vsock_test.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ static void test_stream_msg_peek_server(const struct test_opts *opts)
351351

352352
static void test_seqpacket_msg_bounds_client(const struct test_opts *opts)
353353
{
354+
unsigned long long sock_buf_size;
354355
unsigned long curr_hash;
355356
size_t max_msg_size;
356357
int page_size;
@@ -363,6 +364,16 @@ static void test_seqpacket_msg_bounds_client(const struct test_opts *opts)
363364
exit(EXIT_FAILURE);
364365
}
365366

367+
sock_buf_size = SOCK_BUF_SIZE;
368+
369+
setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_MAX_SIZE,
370+
sock_buf_size,
371+
"setsockopt(SO_VM_SOCKETS_BUFFER_MAX_SIZE)");
372+
373+
setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_SIZE,
374+
sock_buf_size,
375+
"setsockopt(SO_VM_SOCKETS_BUFFER_SIZE)");
376+
366377
/* Wait, until receiver sets buffer size. */
367378
control_expectln("SRVREADY");
368379

0 commit comments

Comments
 (0)