• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# Copyright (c) 2015 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# It requires remote host. Test will setup IPv4 and IPv6 virtual
20# tunnel between two hosts, then will compare TCP performance
21# with and without GRE using ping or tcp_fastopen test.
22
23TCID=gre01
24TST_TOTAL=1
25
26. test_net.sh
27
28virt_type="gre"
29[ "$TST_IPV6" ] && virt_type="ip6gre"
30
31. virt_lib.sh
32
33cleanup()
34{
35	cleanup_vifaces
36	tst_rhost_run -c "ip link delete ltp_v0"
37	if [ "$net_load" = "TFO" ]; then
38		tst_rhost_run -c "pkill -9 tcp_fastopen\$"
39		pkill -9 "tcp_fastopen\$"
40	fi
41}
42TST_CLEANUP="cleanup"
43
44if [ "$net_load" = "TFO" ]; then
45	tst_check_cmds "tcp_fastopen"
46fi
47
48if [ -z $ip_local -o -z $ip_remote ]; then
49	tst_brkm TBROK "you must specify IP address"
50fi
51
52tst_resm TINFO "test $virt_type"
53virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \
54"local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)"
55
56virt_compare_netperf
57
58tst_exit
59