README 2.4 KB

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