From: Arkadi Sharshevsky <arkadis@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, mlxsw@mellanox.com,
Arkadi Sharshevsky <arkadis@mellanox.com>
Subject: [PATCH net-next] selftests: Extend the tc action test for action mirror
Date: Sun, 4 Mar 2018 16:35:26 +0200 [thread overview]
Message-ID: <1520174126-7770-1-git-send-email-arkadis@mellanox.com> (raw)
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>
---
tools/testing/selftests/net/forwarding/tc_actions.sh | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
index 8423431..bc09a36 100755
--- a/tools/testing/selftests/net/forwarding/tc_actions.sh
+++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
@@ -45,8 +45,10 @@ switch_destroy()
simple_if_fini $swp1 192.0.2.2/24
}
-mirred_egress_redirect_test()
+mirred_egress_test()
{
+ local action=$1
+
RET=0
tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
@@ -59,19 +61,19 @@ mirred_egress_redirect_test()
check_fail $? "Matched without redirect rule inserted"
tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \
- $tcflags dst_ip 192.0.2.2 action mirred egress redirect \
+ $tcflags dst_ip 192.0.2.2 action mirred egress $action \
dev $swp2
$MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
-t ip -q
tc_check_packets "dev $h2 ingress" 101 1
- check_err $? "Did not match incoming redirected packet"
+ check_err $? "Did not match incoming $action packet"
tc filter del dev $swp1 ingress protocol ip pref 1 handle 101 flower
tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
- log_test "mirred egress redirect ($tcflags)"
+ log_test "mirred egress $action ($tcflags)"
}
gact_drop_and_ok_test()
@@ -180,7 +182,8 @@ setup_prepare
setup_wait
gact_drop_and_ok_test
-mirred_egress_redirect_test
+mirred_egress_test "redirect"
+mirred_egress_test "mirror"
tc_offload_check
if [[ $? -ne 0 ]]; then
@@ -188,7 +191,8 @@ if [[ $? -ne 0 ]]; then
else
tcflags="skip_sw"
gact_drop_and_ok_test
- mirred_egress_redirect_test
+ mirred_egress_test "redirect"
+ mirred_egress_test "mirror"
gact_trap_test
fi
--
2.4.11
next reply other threads:[~2018-03-04 14:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-04 14:35 Arkadi Sharshevsky [this message]
2018-03-05 15:27 ` [PATCH net-next] selftests: Extend the tc action test for action mirror David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520174126-7770-1-git-send-email-arkadis@mellanox.com \
--to=arkadis@mellanox.com \
--cc=davem@davemloft.net \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).