test/vsock: MSG_ZEROCOPY flag tests
authorArseniy Krasnov <avkrasnov@salutedevices.com>
Tue, 10 Oct 2023 19:15:22 +0000 (22:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2023 12:19:42 +0000 (13:19 +0100)
commitbc36442ef3b776ee6d5148a4e175c367af057ce1
treea5b1db2ab8200337042a6d7caf6f343199a9a8a1
parentbac2cac12c266755fa4b933d88e70bc18580b80f
test/vsock: MSG_ZEROCOPY flag tests

This adds three tests for MSG_ZEROCOPY feature:
1) SOCK_STREAM tx with different buffers.
2) SOCK_SEQPACKET tx with different buffers.
3) SOCK_STREAM test to read empty error queue of the socket.

Patch also works as preparation for the next patches for tools in this
patchset: vsock_perf and vsock_uring_test:
1) Adds several new functions to util.c - they will be also used by
   vsock_uring_test.
2) Adds two new functions for MSG_ZEROCOPY handling to a new source
   file - such source will be shared between vsock_test, vsock_perf and
   vsock_uring_test, thus avoiding code copy-pasting.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/vsock/Makefile
tools/testing/vsock/msg_zerocopy_common.c [new file with mode: 0644]
tools/testing/vsock/msg_zerocopy_common.h [new file with mode: 0644]
tools/testing/vsock/util.c
tools/testing/vsock/util.h
tools/testing/vsock/vsock_test.c
tools/testing/vsock/vsock_test_zerocopy.c [new file with mode: 0644]
tools/testing/vsock/vsock_test_zerocopy.h [new file with mode: 0644]