vxlan03.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
  4. # Copyright (c) 2014-2017 Oracle and/or its affiliates.
  5. # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
  6. #
  7. # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
  8. # sub-nets between two hosts, then will compare TCP performance
  9. # with and without VxLAN using ping or netstress test.
  10. #
  11. # Test-case 2: The same as above but must fail, because VXLAN allows
  12. # to communicate only within the same VXLAN segment.
  13. TST_NEEDS_TMPDIR=1
  14. TST_OPTS="hi:d:"
  15. TST_PARSE_ARGS=virt_lib_parse_args
  16. TST_USAGE=virt_lib_usage
  17. virt_type="vxlan"
  18. start_id=16700000
  19. # Destination address, can be unicast or multicast address
  20. vxlan_dst_addr="uni"
  21. TST_TEST_DATA=",gbp"
  22. TST_TEST_DATA_IFS=","
  23. TST_NEEDS_TMPDIR=1
  24. TST_TESTFUNC=do_test
  25. TST_CLEANUP=virt_cleanup
  26. # In average cases (with small packets less then 150 bytes) VxLAN slower
  27. # by 10-30%. If hosts are too close to each other, e.g. connected to the same
  28. # switch, VxLAN can be much slower when comparing to the performance without
  29. # any encapsulation.
  30. VIRT_PERF_THRESHOLD_MIN=160
  31. . virt_lib.sh
  32. do_test()
  33. {
  34. virt_check_cmd virt_add ltp_v0 id 0 $2 || return
  35. tst_res TINFO "the same VNI must work"
  36. # VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE
  37. vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFE $2"
  38. virt_netperf_msg_sizes
  39. virt_cleanup_rmt
  40. tst_res TINFO "different VNI shall not work together"
  41. vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFD $2"
  42. virt_minimize_timeout
  43. virt_compare_netperf "fail"
  44. virt_cleanup_rmt
  45. }
  46. tst_run