3 These tests exercise net/vmw_vsock/ host<->guest sockets for VMware, KVM, and
6 The following tests are available:
8 * vsock_test - core AF_VSOCK socket functionality
9 * vsock_diag_test - vsock_diag.ko module for listing open sockets
11 The following prerequisite steps are not automated and must be performed prior
14 1. Build the kernel, make headers_install, and build these tests.
15 2. Install the kernel and tests on the host.
16 3. Install the kernel and tests inside the guest.
17 4. Boot the guest and ensure that the AF_VSOCK transport is enabled.
19 Invoke test binaries in both directions as follows:
21 # host=server, guest=client
22 (host)# $TEST_BINARY --mode=server \
25 (guest)# $TEST_BINARY --mode=client \
26 --control-host=$HOST_IP \
30 # host=client, guest=server
31 (guest)# $TEST_BINARY --mode=server \
34 (host)# $TEST_BINARY --mode=client \
35 --control-port=$GUEST_IP \
41 'vsock_perf' is a simple tool to measure vsock performance. It works in
42 sender/receiver modes: sender connect to peer at the specified port and
43 starts data transmission to the receiver. After data processing is done,
44 it prints several metrics(see below).
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
52 tx performance: A Gbits/s
55 A is calculated as "number of bits to send" / "time in tx loop"
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
62 rx performance: A Gbits/s
63 total in 'read()': B sec
65 average in 'read()': D ns
68 A is calculated as "number of received bits" / "time in rx loop".
69 B is time, spent in 'read()' system call(excluding 'poll()')
70 C is number of 'poll()' wake ups with POLLIN bit set.
71 D is B / C, e.g. average amount of time, spent in single 'read()'.