• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.gitignoreD22-Nov-202499 76

MakefileD22-Nov-20241.1 KiB2923

READMED22-Nov-20242.4 KiB7257

control.cD22-Nov-20244.7 KiB255175

control.hD22-Nov-2024495 1813

msg_zerocopy_common.cD22-Nov-20242 KiB8861

msg_zerocopy_common.hD22-Nov-2024358 1912

timeout.cD22-Nov-20241.3 KiB6126

timeout.hD22-Nov-2024301 1610

util.cD22-Nov-202413.4 KiB654463

util.hD22-Nov-20242.5 KiB7254

vsock_diag_test.cD22-Nov-202411.7 KiB597502

vsock_perf.cD22-Nov-202410 KiB490399

vsock_test.cD22-Nov-202438.3 KiB1,7711,344

vsock_test_zerocopy.cD22-Nov-20247.5 KiB359267

vsock_test_zerocopy.hD22-Nov-2024573 1610

vsock_uring_test.cD22-Nov-20247.5 KiB354285

README

1AF_VSOCK test suite
2-------------------
3These tests exercise net/vmw_vsock/ host<->guest sockets for VMware, KVM, and
4Hyper-V.
5
6The following tests are available:
7
8  * vsock_test - core AF_VSOCK socket functionality
9  * vsock_diag_test - vsock_diag.ko module for listing open sockets
10
11The following prerequisite steps are not automated and must be performed prior
12to running tests:
13
141. Build the kernel, make headers_install, and build these tests.
152. Install the kernel and tests on the host.
163. Install the kernel and tests inside the guest.
174. Boot the guest and ensure that the AF_VSOCK transport is enabled.
18
19Invoke test binaries in both directions as follows:
20
21  # host=server, guest=client
22  (host)# $TEST_BINARY --mode=server \
23                       --control-port=1234 \
24                       --peer-cid=3
25  (guest)# $TEST_BINARY --mode=client \
26                        --control-host=$HOST_IP \
27                        --control-port=1234 \
28                        --peer-cid=2
29
30  # host=client, guest=server
31  (guest)# $TEST_BINARY --mode=server \
32                        --control-port=1234 \
33                        --peer-cid=2
34  (host)# $TEST_BINARY --mode=client \
35                       --control-port=$GUEST_IP \
36                       --control-port=1234 \
37                       --peer-cid=3
38
39vsock_perf utility
40-------------------
41'vsock_perf' is a simple tool to measure vsock performance. It works in
42sender/receiver modes: sender connect to peer at the specified port and
43starts data transmission to the receiver. After data processing is done,
44it prints several metrics(see below).
45
46Usage:
47# run as sender
48# connect to CID 2, port 1234, send 1G of data, tx buf size is 1M
49./vsock_perf --sender 2 --port 1234 --bytes 1G --buf-size 1M
50
51Output:
52tx performance: A Gbits/s
53
54Output explanation:
55A is calculated as "number of bits to send" / "time in tx loop"
56
57# run as receiver
58# listen port 1234, rx buf size is 1M, socket buf size is 1G, SO_RCVLOWAT is 64K
59./vsock_perf --port 1234 --buf-size 1M --vsk-size 1G --rcvlowat 64K
60
61Output:
62rx performance: A Gbits/s
63total in 'read()': B sec
64POLLIN wakeups: C
65average in 'read()': D ns
66
67Output explanation:
68A is calculated as "number of received bits" / "time in rx loop".
69B is time, spent in 'read()' system call(excluding 'poll()')
70C is number of 'poll()' wake ups with POLLIN bit set.
71D is B / C, e.g. average amount of time, spent in single 'read()'.
72