mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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>
This commit is contained in:
committed by
David S. Miller
parent
bac2cac12c
commit
bc36442ef3
18
tools/testing/vsock/msg_zerocopy_common.h
Normal file
18
tools/testing/vsock/msg_zerocopy_common.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef MSG_ZEROCOPY_COMMON_H
|
||||
#define MSG_ZEROCOPY_COMMON_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef SOL_VSOCK
|
||||
#define SOL_VSOCK 287
|
||||
#endif
|
||||
|
||||
#ifndef VSOCK_RECVERR
|
||||
#define VSOCK_RECVERR 1
|
||||
#endif
|
||||
|
||||
void enable_so_zerocopy(int fd);
|
||||
void vsock_recv_completion(int fd, const bool *zerocopied);
|
||||
|
||||
#endif /* MSG_ZEROCOPY_COMMON_H */
|
||||
Reference in New Issue
Block a user