1#!/bin/sh 2# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved. 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@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 tcp_fastopen 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 26TCID=vxlan03 27TST_TOTAL=4 28 29virt_type="vxlan" 30start_id=16700000 31 32# Destination address, can be unicast or multicast address 33vxlan_dst_addr="uni" 34 35. test_net.sh 36. virt_lib.sh 37 38# In average cases (with small packets less then 150 bytes) VxLAN slower 39# by 10-30%. If hosts are too close to each other, e.g. connected to the same 40# switch, VxLAN can be much slower when comparing to the performance without 41# any encapsulation. 42VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-160} 43[ "$VIRT_PERF_THRESHOLD" -lt 160 ] && VIRT_PERF_THRESHOLD=160 44 45cleanup() 46{ 47 cleanup_vifaces 48 tst_rhost_run -c "ip link delete ltp_v0" 49 if [ "$net_load" = "TFO" ]; then 50 tst_rhost_run -c "pkill -9 tcp_fastopen\$" 51 pkill -9 "tcp_fastopen\$" 52 fi 53} 54TST_CLEANUP="cleanup" 55 56if [ "$net_load" = "TFO" ]; then 57 tst_check_cmds "tcp_fastopen" 58fi 59 60if [ -z $ip_local -o -z $ip_remote ]; then 61 tst_brkm TBROK "you must specify IP address" 62fi 63 64opts=" ,gbp" 65 66for n in $(seq 1 2); do 67 p="$(echo $opts | cut -d',' -f$n)" 68 69 virt_check_cmd virt_add ltp_v0 id 0 $p || continue 70 71 tst_resm TINFO "the same VNI must work" 72 # VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE 73 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFE $p" 74 virt_compare_netperf 75 76 tst_resm TINFO "different VNI shall not work together" 77 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFD $p" 78 virt_compare_netperf "fail" 79done 80 81tst_exit 82