Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: Extend the tc action test for action mirror

Currently the tc action test is used only to test mirred redirect
action. This patch extends it for mirred mirror.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arkadi Sharshevsky and committed by
David S. Miller
200066a5 e6c6a929

+10 -6
+10 -6
tools/testing/selftests/net/forwarding/tc_actions.sh
··· 45 45 simple_if_fini $swp1 192.0.2.2/24 46 46 } 47 47 48 - mirred_egress_redirect_test() 48 + mirred_egress_test() 49 49 { 50 + local action=$1 51 + 50 52 RET=0 51 53 52 54 tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \ ··· 61 59 check_fail $? "Matched without redirect rule inserted" 62 60 63 61 tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \ 64 - $tcflags dst_ip 192.0.2.2 action mirred egress redirect \ 62 + $tcflags dst_ip 192.0.2.2 action mirred egress $action \ 65 63 dev $swp2 66 64 67 65 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \ 68 66 -t ip -q 69 67 70 68 tc_check_packets "dev $h2 ingress" 101 1 71 - check_err $? "Did not match incoming redirected packet" 69 + check_err $? "Did not match incoming $action packet" 72 70 73 71 tc filter del dev $swp1 ingress protocol ip pref 1 handle 101 flower 74 72 tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower 75 73 76 - log_test "mirred egress redirect ($tcflags)" 74 + log_test "mirred egress $action ($tcflags)" 77 75 } 78 76 79 77 gact_drop_and_ok_test() ··· 182 180 setup_wait 183 181 184 182 gact_drop_and_ok_test 185 - mirred_egress_redirect_test 183 + mirred_egress_test "redirect" 184 + mirred_egress_test "mirror" 186 185 187 186 tc_offload_check 188 187 if [[ $? -ne 0 ]]; then ··· 191 188 else 192 189 tcflags="skip_sw" 193 190 gact_drop_and_ok_test 194 - mirred_egress_redirect_test 191 + mirred_egress_test "redirect" 192 + mirred_egress_test "mirror" 195 193 gact_trap_test 196 194 fi 197 195