1 #!/bin/sh 2 # Copyright (c) 2014-2017 Oracle and/or its affiliates. 3 # 4 # This program is free software; you can redistribute it and/or 5 # modify it under the terms of the GNU General Public License as 6 # published by the Free Software Foundation; either version 2 of 7 # the License, or (at your option) any later version. 8 # 9 # This program is distributed in the hope that it would be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 # 17 # Author: Alexey Kodanev <alexey.kodanev (at] oracle.com> 18 # 19 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual 20 # sub-nets between two hosts, then will compare TCP performance 21 # with and without VxLAN using ping or netstress test. 22 # 23 # Test-case 2: The same as above but must fail, because VXLAN allows 24 # to communicate only within the same VXLAN segment. 25 26 TCID=vxlan03 27 TST_TOTAL=4 28 TST_NEEDS_TMPDIR=1 29 30 virt_type="vxlan" 31 start_id=16700000 32 33 # Destination address, can be unicast or multicast address 34 vxlan_dst_addr="uni" 35 36 . test_net.sh 37 . virt_lib.sh 38 39 # In average cases (with small packets less then 150 bytes) VxLAN slower 40 # by 10-30%. If hosts are too close to each other, e.g. connected to the same 41 # switch, VxLAN can be much slower when comparing to the performance without 42 # any encapsulation. 43 VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-160} 44 [ "$VIRT_PERF_THRESHOLD" -lt 160 ] && VIRT_PERF_THRESHOLD=160 45 46 TST_CLEANUP="virt_cleanup" 47 48 if [ -z $ip_local -o -z $ip_remote ]; then 49 tst_brkm TBROK "you must specify IP address" 50 fi 51 52 opts=" ,gbp" 53 54 for n in $(seq 1 2); do 55 p="$(echo $opts | cut -d',' -f$n)" 56 57 virt_check_cmd virt_add ltp_v0 id 0 $p || continue 58 59 tst_resm TINFO "the same VNI must work" 60 # VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE 61 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFE $p" 62 virt_netperf_msg_sizes 63 virt_cleanup_rmt 64 65 tst_resm TINFO "different VNI shall not work together" 66 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFD $p" 67 virt_minimize_timeout 68 virt_compare_netperf "fail" 69 virt_cleanup_rmt 70 done 71 72 tst_exit 73