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 4/4] selftests: forwarding: Test redirecting vxlan and bareudp packets to Ethernet
Date: Wed, 30 Jun 2021 14:51:49 +0200 [thread overview]
Message-ID: <340d1bce299c23e3f7e97d8b71b0f38a2ce0a7e3.1625056665.git.gnault@redhat.com> (raw)
In-Reply-To: <cover.1625056665.git.gnault@redhat.com>
Add selftests for the following commit:
* 99c8719b7981 ("bareudp: allow redirecting bareudp packets to eth
devices").
(no commit for VXLAN-GPE, which has always worked in this configuration).
Only test collect-md mode as both bareudp and vxlan-gpe devices don't
currently implement classical mode.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
tools/testing/selftests/net/forwarding/config | 2 +
.../net/forwarding/tc_redirect_l2l3.sh | 55 +++++++++++++++++++
2 files changed, 57 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/config b/tools/testing/selftests/net/forwarding/config
index 5d3ab2b63c53..ec49660ee808 100644
--- a/tools/testing/selftests/net/forwarding/config
+++ b/tools/testing/selftests/net/forwarding/config
@@ -21,3 +21,5 @@ CONFIG_NET_IPIP=m
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_IPV6_TUNNEL=m
+CONFIG_VXLAN=m
+CONFIG_BAREUDP=m
diff --git a/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh b/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
index 207b92775a6c..db8ccef9a334 100755
--- a/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
+++ b/tools/testing/selftests/net/forwarding/tc_redirect_l2l3.sh
@@ -27,6 +27,8 @@ ALL_TESTS="
redir_sit
redir_ip6gre
redir_ip6tnl
+ redir_vxlan_gpe
+ redir_bareudp
"
NUM_NETIFS=0
@@ -354,6 +356,59 @@ redir_ip6tnl()
cleanup_tunnel
}
+redir_vxlan_gpe()
+{
+ local IP
+
+ # As of Linux 5.13, VXLAN-GPE only supports collect-md mode
+ for UNDERLAY_IPVERS in 4 6; do
+ IP="IPv${UNDERLAY_IPVERS}"
+
+ setup_tunnel "${IP}" "collect_md" "vxlan" "gpe external" "id 10"
+ ping_test ipv4 "VXLAN-GPE, external mode: ${IP} / UDP / VXLAN-GPE / IPv4"
+ ping_test ipv6 "VXLAN-GPE, external mode: ${IP} / UDP / VXLAN-GPE / IPv6"
+ ping_test ipv4-mpls "VXLAN-GPE, external mode: ${IP} / UDP / VXLAN-GPE / MPLS / IPv4"
+ ping_test ipv6-mpls "VXLAN-GPE, external mode: ${IP} / UDP / VXLAN-GPE / MPLS / IPv6"
+ cleanup_tunnel
+ done
+}
+
+redir_bareudp()
+{
+ local IP
+
+ # As of Linux 5.13, Bareudp only supports collect-md mode
+ for UNDERLAY_IPVERS in 4 6; do
+ IP="IPv${UNDERLAY_IPVERS}"
+
+ # IPv4 overlay
+ setup_tunnel "${IP}" "collect_md" "bareudp" \
+ "dstport 6635 ethertype ipv4"
+ ping_test ipv4 "Bareudp, external mode: ${IP} / UDP / IPv4"
+ cleanup_tunnel
+
+ # IPv6 overlay
+ setup_tunnel "${IP}" "collect_md" "bareudp" \
+ "dstport 6635 ethertype ipv6"
+ ping_test ipv6 "Bareudp, external mode: ${IP} / UDP / IPv6"
+ cleanup_tunnel
+
+ # Combined IPv4/IPv6 overlay (multiproto mode)
+ setup_tunnel "${IP}" "collect_md" "bareudp" \
+ "dstport 6635 ethertype ipv4 multiproto"
+ ping_test ipv4 "Bareudp, external mode: ${IP} / UDP / IPv4 (multiproto)"
+ ping_test ipv6 "Bareudp, external mode: ${IP} / UDP / IPv6 (multiproto)"
+ cleanup_tunnel
+
+ # MPLS overlay
+ setup_tunnel "${IP}" "collect_md" "bareudp" \
+ "dstport 6635 ethertype mpls_uc"
+ ping_test ipv4-mpls "Bareudp, external mode: ${IP} / UDP / MPLS / IPv4"
+ ping_test ipv6-mpls "Bareudp, external mode: ${IP} / UDP / MPLS / IPv6"
+ cleanup_tunnel
+ done
+}
+
exit_cleanup()
{
if [ "${TESTS_COMPLETED}" = "no" ]; then
--
2.21.3
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 ` [PATCH net-next 3/4] selftests: forwarding: Test redirecting ip6gre and ip6tnl " Guillaume Nault
2021-06-30 12:51 ` Guillaume Nault [this message]
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=340d1bce299c23e3f7e97d8b71b0f38a2ce0a7e3.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).