Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 5c338112e48a ("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>

authored by

Stefano Garzarella and committed by
Paolo Abeni
0a98de80 3ef3d52a

+11
+11
tools/testing/vsock/vsock_test.c
··· 351 351 352 352 static void test_seqpacket_msg_bounds_client(const struct test_opts *opts) 353 353 { 354 + unsigned long long sock_buf_size; 354 355 unsigned long curr_hash; 355 356 size_t max_msg_size; 356 357 int page_size; ··· 363 362 perror("connect"); 364 363 exit(EXIT_FAILURE); 365 364 } 365 + 366 + sock_buf_size = SOCK_BUF_SIZE; 367 + 368 + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_MAX_SIZE, 369 + sock_buf_size, 370 + "setsockopt(SO_VM_SOCKETS_BUFFER_MAX_SIZE)"); 371 + 372 + setsockopt_ull_check(fd, AF_VSOCK, SO_VM_SOCKETS_BUFFER_SIZE, 373 + sock_buf_size, 374 + "setsockopt(SO_VM_SOCKETS_BUFFER_SIZE)"); 366 375 367 376 /* Wait, until receiver sets buffer size. */ 368 377 control_expectln("SRVREADY");