From: Petr Machata Date: Thu, 31 May 2018 17:52:15 +0000 (+0200) Subject: selftests: forwarding: mirror_lib: skip_hw the VLAN capture X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=275225fb4e3981a55b19ad0caad2eeb2821ae3d5;p=openwrt%2Fstaging%2Fblogic.git selftests: forwarding: mirror_lib: skip_hw the VLAN capture When the VLAN capture is installed on a front panel device and not a soft device, the packets are counted twice: once in fast path, and once after they are trapped to the kernel. Resolve the problem by passing skip_hw flag to vlan_capture_install(). Signed-off-by: Petr Machata Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 67efe2556a4d..d36dc26c6c51 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -102,7 +102,10 @@ do_test_span_vlan_dir_ips() local ip1=$1; shift local ip2=$1; shift - vlan_capture_install $dev "vlan_id $vid" + # Install the capture as skip_hw to avoid double-counting of packets. + # The traffic is meant for local box anyway, so will be trapped to + # kernel. + vlan_capture_install $dev "skip_hw vlan_id $vid" mirror_test v$h1 $ip1 $ip2 $dev 100 $expect mirror_test v$h2 $ip2 $ip1 $dev 100 $expect vlan_capture_uninstall $dev