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