From: Guillaume Nault <gnault@redhat.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org
Subject: [PATCH net-next 3/4] selftests: forwarding: Test redirecting ip6gre and ip6tnl packets to Ethernet
Date: Wed, 30 Jun 2021 14:51:45 +0200 [thread overview]
Message-ID: <a7e9114c4c091fe7a39cc4c7ab42b6c1f53b3df4.1625056665.git.gnault@redhat.com> (raw)
In-Reply-To: <cover.1625056665.git.gnault@redhat.com>
Add selftests for the following commit:
* da5a2e49f064 ("ip6_tunnel: allow redirecting ip6gre and ipxip6
packets to eth devices").
Like with the previous tc_redirect_l2l3.sh tests, verify that the
following tc filter works on the ingress qdisc of ip6gre and ip6tnl
devices:
$ tc filter add dev tunnel0 ingress matchall \
action vlan push_eth dst_mac 00:00:5e:00:53:01 \
src_mac 00:00:5e:00:53:00 \
action mirred egress redirect dev eth0
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
tools/testing/selftests/net/forwarding/config | 2 ++
.../net/forwarding/tc_redirect_l2l3.sh | 36 +++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/config b/tools/testing/selftests/net/forwarding/config
index c543b441a8b5..5d3ab2b63c53 100644
--- a/tools/testing/selftests/net/forwarding/config
+++ b/tools/testing/selftests/net/forwarding/config
@@ -19,3 +19,5 @@ CONFIG_NET_NS=y
CONFIG_NET_IPGRE=m
CONFIG_NET_IPIP=m
CONFIG_IPV6_SIT=m
+CONFIG_IPV6_GRE=m
+CONFIG_IPV6_TUNNEL=m
diff --git a/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh b/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
index fd9e15a6417b..207b92775a6c 100755
--- a/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
+++ b/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
@@ -25,6 +25,8 @@ ALL_TESTS="
redir_gre
redir_ipip
redir_sit
+ redir_ip6gre
+ redir_ip6tnl
"
NUM_NETIFS=0
@@ -318,6 +320,40 @@ redir_sit()
cleanup_tunnel
}
+redir_ip6gre()
+{
+ setup_tunnel "ipv6" "classical" "ip6gre"
+ ping_test ipv4 "IP6GRE, classical mode: IPv6 / GRE / IPv4"
+ ping_test ipv6 "IP6GRE, classical mode: IPv6 / GRE / IPv6"
+ ping_test ipv4-mpls "IP6GRE, classical mode: IPv6 / GRE / MPLS / IPv4"
+ ping_test ipv6-mpls "IP6GRE, classical mode: IPv6 / GRE / MPLS / IPv6"
+ cleanup_tunnel
+
+ setup_tunnel "ipv6" "collect_md" "ip6gre" "external" "nocsum"
+ ping_test ipv4 "IP6GRE, external mode: IPv6 / GRE / IPv4"
+ ping_test ipv6 "IP6GRE, external mode: IPv6 / GRE / IPv6"
+ ping_test ipv4-mpls "IP6GRE, external mode: IPv6 / GRE / MPLS / IPv4"
+ ping_test ipv6-mpls "IP6GRE, external mode: IPv6 / GRE / MPLS / IPv6"
+ cleanup_tunnel
+}
+
+redir_ip6tnl()
+{
+ setup_tunnel "ipv6" "classical" "ip6tnl" "mode any"
+ ping_test ipv4 "IP6TNL, classical mode: IPv6 / IPv4"
+ ping_test ipv6 "IP6TNL, classical mode: IPv6 / IPv6"
+ ping_test ipv4-mpls "IP6TNL, classical mode: IPv6 / MPLS / IPv4"
+ ping_test ipv6-mpls "IP6TNL, classical mode: IPv6 / MPLS / IPv6"
+ cleanup_tunnel
+
+ setup_tunnel "ipv6" "collect_md" "ip6tnl" "mode any external"
+ ping_test ipv4 "IP6TNL, external mode: IPv6 / IPv4"
+ ping_test ipv6 "IP6TNL, external mode: IPv6 / IPv6"
+ ping_test ipv4-mpls "IP6TNL, external mode: IPv6 / MPLS / IPv4"
+ ping_test ipv6-mpls "IP6TNL, external mode: IPv6 / MPLS / IPv6"
+ cleanup_tunnel
+}
+
exit_cleanup()
{
if [ "${TESTS_COMPLETED}" = "no" ]; then
--
2.21.3
next prev parent reply other threads:[~2021-06-30 12:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 12:51 [PATCH net-next 0/4] selftests: forwarding: Tests redirects between L3 and L2 devices Guillaume Nault
2021-06-30 12:51 ` [PATCH net-next 1/4] selftests: forwarding: Test redirecting gre or ipip packets to Ethernet Guillaume Nault
2021-07-01 5:46 ` Ido Schimmel
2021-07-01 14:59 ` Guillaume Nault
2021-07-01 15:38 ` David Ahern
2021-07-01 16:59 ` Guillaume Nault
2021-07-06 19:02 ` Guillaume Nault
2021-07-07 15:05 ` David Ahern
2021-07-07 15:42 ` Guillaume Nault
2021-07-08 1:50 ` David Ahern
2021-07-09 16:21 ` Guillaume Nault
2021-06-30 12:51 ` [PATCH net-next 2/4] selftests: forwarding: Test redirecting sit " Guillaume Nault
2021-06-30 12:51 ` Guillaume Nault [this message]
2021-06-30 12:51 ` [PATCH net-next 4/4] selftests: forwarding: Test redirecting vxlan and bareudp " Guillaume Nault
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=a7e9114c4c091fe7a39cc4c7ab42b6c1f53b3df4.1625056665.git.gnault@redhat.com \
--to=gnault@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuah@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).