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 14TST_NEEDS_TMPDIR=1 15TST_OPTS="hi:d:" 16TST_PARSE_ARGS=virt_lib_parse_args 17TST_USAGE=virt_lib_usage 18 19virt_type="vxlan" 20start_id=16700000 21 22# Destination address, can be unicast or multicast address 23vxlan_dst_addr="uni" 24 25TST_TEST_DATA=",gbp" 26TST_TEST_DATA_IFS="," 27TST_NEEDS_TMPDIR=1 28TST_TESTFUNC=do_test 29TST_CLEANUP=virt_cleanup 30# In average cases (with small packets less then 150 bytes) VxLAN slower 31# by 10-30%. If hosts are too close to each other, e.g. connected to the same 32# switch, VxLAN can be much slower when comparing to the performance without 33# any encapsulation. 34VIRT_PERF_THRESHOLD_MIN=160 35. virt_lib.sh 36 37do_test() 38{ 39 if [ -z $ip_local -o -z $ip_remote ]; then 40 tst_brk TBROK "you must specify IP address" 41 fi 42 43 virt_check_cmd virt_add ltp_v0 id 0 $2 || continue 44 45 tst_res TINFO "the same VNI must work" 46 # VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE 47 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFE $2" 48 virt_netperf_msg_sizes 49 virt_cleanup_rmt 50 51 tst_res TINFO "different VNI shall not work together" 52 vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFD $2" 53 virt_minimize_timeout 54 virt_compare_netperf "fail" 55 virt_cleanup_rmt 56} 57 58tst_run 59