netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: William Tu <u9012063@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	bpf@vger.kernel.org, Hangbin Liu <liuhangbin@gmail.com>
Subject: [PATCH bpf-next 1/2] selftest/bpf: add missed ip6ip6 test back
Date: Tue,  3 Nov 2020 12:29:07 +0800	[thread overview]
Message-ID: <20201103042908.2825734-2-liuhangbin@gmail.com> (raw)
In-Reply-To: <20201103042908.2825734-1-liuhangbin@gmail.com>

In comment 173ca26e9b51 ("samples/bpf: add comprehensive ipip, ipip6,
ip6ip6 test") we added ip6ip6 test for bpf tunnel testing. But in commit
933a741e3b82 ("selftests/bpf: bpf tunnel test.") when we moved it to
the current folder, we didn't add it.

This patch add the ip6ip6 test back to bpf tunnel test. Since the
underlay network is the same, we can reuse the ipip6 framework directly.
Iperf test is removed as currect framework simplified it in purpose.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/bpf/test_tunnel.sh | 39 ++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_tunnel.sh b/tools/testing/selftests/bpf/test_tunnel.sh
index bd12ec97a44d..76a00d2ef988 100755
--- a/tools/testing/selftests/bpf/test_tunnel.sh
+++ b/tools/testing/selftests/bpf/test_tunnel.sh
@@ -24,12 +24,12 @@
 # Root namespace with metadata-mode tunnel + BPF
 # Device names and addresses:
 # 	veth1 IP: 172.16.1.200, IPv6: 00::22 (underlay)
-# 	tunnel dev <type>11, ex: gre11, IPv4: 10.1.1.200 (overlay)
+# 	tunnel dev <type>11, ex: gre11, IPv4: 10.1.1.200, IPv6: 1::22 (overlay)
 #
 # Namespace at_ns0 with native tunnel
 # Device names and addresses:
 # 	veth0 IPv4: 172.16.1.100, IPv6: 00::11 (underlay)
-# 	tunnel dev <type>00, ex: gre00, IPv4: 10.1.1.100 (overlay)
+# 	tunnel dev <type>00, ex: gre00, IPv4: 10.1.1.100, IPv6: 1::11 (overlay)
 #
 #
 # End-to-end ping packet flow
@@ -262,11 +262,13 @@ add_ipip6tnl_tunnel()
 		ip link add dev $DEV_NS type $TYPE \
 		local ::11 remote ::22
 	ip netns exec at_ns0 ip addr add dev $DEV_NS 10.1.1.100/24
+	ip netns exec at_ns0 ip addr add dev $DEV_NS 1::11/96
 	ip netns exec at_ns0 ip link set dev $DEV_NS up
 
 	# root namespace
 	ip link add dev $DEV type $TYPE external
 	ip addr add dev $DEV 10.1.1.200/24
+	ip addr add dev $DEV 1::22/96
 	ip link set dev $DEV up
 }
 
@@ -553,6 +555,34 @@ test_ipip6()
         echo -e ${GREEN}"PASS: $TYPE"${NC}
 }
 
+test_ip6ip6()
+{
+	TYPE=ip6tnl
+	DEV_NS=ip6ip6tnl00
+	DEV=ip6ip6tnl11
+	ret=0
+
+	check $TYPE
+	config_device
+	add_ipip6tnl_tunnel
+	ip link set dev veth1 mtu 1500
+	attach_bpf $DEV ipip6_set_tunnel ipip6_get_tunnel
+	# underlay
+	ping6 $PING_ARG ::11
+	# ip6 over ip6
+	ping6 $PING_ARG 1::11
+	check_err $?
+	ip netns exec at_ns0 ping6 $PING_ARG 1::22
+	check_err $?
+	cleanup
+
+	if [ $ret -ne 0 ]; then
+                echo -e ${RED}"FAIL: ip6$TYPE"${NC}
+                return 1
+        fi
+        echo -e ${GREEN}"PASS: ip6$TYPE"${NC}
+}
+
 setup_xfrm_tunnel()
 {
 	auth=0x$(printf '1%.0s' {1..40})
@@ -646,6 +676,7 @@ cleanup()
 	ip link del veth1 2> /dev/null
 	ip link del ipip11 2> /dev/null
 	ip link del ipip6tnl11 2> /dev/null
+	ip link del ip6ip6tnl11 2> /dev/null
 	ip link del gretap11 2> /dev/null
 	ip link del ip6gre11 2> /dev/null
 	ip link del ip6gretap11 2> /dev/null
@@ -742,6 +773,10 @@ bpf_tunnel_test()
 	test_ipip6
 	errors=$(( $errors + $? ))
 
+	echo "Testing IP6IP6 tunnel..."
+	test_ip6ip6
+	errors=$(( $errors + $? ))
+
 	echo "Testing IPSec tunnel..."
 	test_xfrm_tunnel
 	errors=$(( $errors + $? ))
-- 
2.25.4


  reply	other threads:[~2020-11-03  4:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  4:29 [PATCH bpf-next 0/2] selftest/bpf: improve bpf tunnel test Hangbin Liu
2020-11-03  4:29 ` Hangbin Liu [this message]
2020-11-04 18:40   ` [PATCH bpf-next 1/2] selftest/bpf: add missed ip6ip6 test back Martin KaFai Lau
2020-11-05  3:20     ` Hangbin Liu
2020-11-03  4:29 ` [PATCH bpf-next 2/2] selftest/bpf: remove unused bpf tunnel testing code Hangbin Liu
2020-11-06  7:30   ` Martin KaFai Lau
2020-11-06  7:55     ` Hangbin Liu
2020-11-06  8:04       ` Hangbin Liu
2020-11-06  9:01 ` [PATCHv2 net 0/2] Remove unused test_ipip.sh test and add missed ip6ip6 test Hangbin Liu
2020-11-06  9:01   ` [PATCHv2 net 1/2] selftest/bpf: add missed ip6ip6 test back Hangbin Liu
2020-11-07  2:15     ` Martin KaFai Lau
2020-11-09  3:00       ` Hangbin Liu
2020-11-09 22:25         ` Martin KaFai Lau
2020-11-06  9:01   ` [PATCHv2 net 2/2] samples/bpf: remove unused test_ipip.sh Hangbin Liu
2020-11-07  2:16     ` Martin KaFai Lau
2020-11-06 18:56   ` [PATCHv2 net 0/2] Remove unused test_ipip.sh test and add missed ip6ip6 test Jakub Kicinski
2020-11-06 18:58     ` Alexei Starovoitov
2020-11-07  1:20     ` Hangbin Liu
2020-11-10  1:50   ` [PATCHv3 bpf " Hangbin Liu
2020-11-10  1:50     ` [PATCHv3 bpf 1/2] selftest/bpf: add missed ip6ip6 test back Hangbin Liu
2020-11-10  1:50     ` [PATCHv3 bpf 2/2] samples/bpf: remove unused test_ipip.sh Hangbin Liu
2020-11-10 17:35     ` [PATCHv3 bpf 0/2] Remove unused test_ipip.sh test and add missed ip6ip6 test Martin KaFai Lau
2020-11-11  0:56       ` Alexei Starovoitov

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=20201103042908.2825734-2-liuhangbin@gmail.com \
    --to=liuhangbin@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=u9012063@gmail.com \
    /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).