2 # SPDX-License-Identifier: GPL-2.0
4 # Test L3 stats on IP-in-IP GRE tunnel without key.
6 # This test uses flat topology for IP tunneling tests. See ipip_lib.sh for more
15 lib_dir
=$
(dirname "$0")
16 source "$lib_dir"/..
/..
/..
/net
/forwarding
/lib.sh
17 source "$lib_dir"/..
/..
/..
/net
/forwarding
/ipip_lib.sh
18 source "$lib_dir"/..
/..
/..
/net
/forwarding
/tc_common.sh
31 ol1mac
=$
(mac_get
$ol1)
37 sw1_flat_create gre
$ol1 $ul1
38 sw2_flat_create gre
$ol2 $ul2
39 ip stats
set dev g1a l3_stats on
40 ip stats
set dev g2a l3_stats on
47 ip stats
set dev g1a l3_stats off
48 ip stats
set dev g2a l3_stats off
50 sw2_flat_destroy
$ol2 $ul2
51 sw1_flat_destroy
$ol1 $ul1
63 ping_test
$h1 192.0.2.18 " gre flat"
68 # Send 21 packets instead of 20, because the first one might trap and go
69 # through the SW datapath, which might not bump the HW counter.
70 $MZ $h1 -c 21 -d 20msec
-p 100 \
71 -a own
-b $ol1mac -A 192.0.2.1 -B 192.0.2.18 \
72 -q -t udp sp
=54321,dp
=12345
85 a
=$
(hw_stats_get l3_stats
$dev $dir packets
)
87 b
=$
(busywait
"$TC_HIT_TIMEOUT" until_counter_is
">= $a + 20" \
88 hw_stats_get l3_stats
$dev $dir packets
)
89 check_err $?
"Traffic not reflected in the counter: $a -> $b"
91 log_test
"Test $dir packets: $prot"