From nobody Tue Feb 10 08:01:10 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4055C332ED8 for ; Fri, 17 Oct 2025 14:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760711380; cv=none; b=YQzAc5B5EfmZzNutr1Ym8qf2GpRDeJiKvOfaOFOhWYX4tAzD5D2TEWTZrMSB0n/l0WEIRiJFvWV/HfccnXnof4iFd65ZSAa9qQk8/Rh46lHxHQ8p71WpKc3HN1rJAgyvE2Svktx6CKJBD/lGjA8OkVoBANTEUH9IiNTZMMLSxDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760711380; c=relaxed/simple; bh=yZNrXnuhvIGexvS5EGtRmXZuWyasmi5dAGGIa6BXW/I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F+0YUVUhxchtQEIPqY3Ad8FZS9rjzpcG62pZ9Yi3hp7ON6WnWG6zAjaDyYhA62MHhXyi6qXpDrMHfoE78UthkyQDmMFE24P0ep6Za4iD76BJSXd+uZZsmf7KQtvBb7ljClTXWBaWVqZ0kcvyjs9nQMmI+JmA85uZCxiHk7G80GY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=W1c6y7AT; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="W1c6y7AT" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 66A074E41147; Fri, 17 Oct 2025 14:29:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 36216606DB; Fri, 17 Oct 2025 14:29:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AA00F102F235B; Fri, 17 Oct 2025 16:29:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760711374; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ftwr4rofYyoL8+AUwR6byHdRTkmIIk8XU5ISZhyl4tY=; b=W1c6y7ATJNfplWdJkqEl95dU5sW2k/j7c+64+Iv9fTWyflLN49SVep/zUXWFRQgmgbku0g joHUjJwY3b7lOB2ZO5tWs3RCvqeBnl0u4pcLLBswRgLDeXodADOu3JN4cmhIDrgIjop/KI Zko2VhkItX977cyo5mrrOa3aLdb7nUB/gDrPctHbXMhvZPeeVQtBCdX/yCzhkDkYSz45tG BU3EMY3DujpHjPk/GP/I3umhIvuOvb//ODFwRMvHFPIow/cgJbxl9x5VayqbRw+MYxtj0f q1kWiG2FAa5BP7Msw/cFxz1rN7XDRtu6pzOUUIIidT6Y+Se20cwFjRsImsrleQ== From: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= Date: Fri, 17 Oct 2025 16:29:05 +0200 Subject: [PATCH bpf-next 5/5] selftests/bpf: remove test_tc_tunnel.sh Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251017-tc_tunnel-v1-5-2d86808d86b2@bootlin.com> References: <20251017-tc_tunnel-v1-0-2d86808d86b2@bootlin.com> In-Reply-To: <20251017-tc_tunnel-v1-0-2d86808d86b2@bootlin.com> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: ebpf@linuxfoundation.org, Thomas Petazzoni , Bastien Curutchet , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 Now that test_tc_tunnel.sh scope has been ported to the test_progs framework, remove it. Signed-off-by: Alexis Lothor=C3=A9 (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - tools/testing/selftests/bpf/test_tc_tunnel.sh | 320 ----------------------= ---- 2 files changed, 321 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests= /bpf/Makefile index 2f248dab922f57e2c14053cb0bdfbb547efe1292..58c768d9da575d8bb9274d32871= 23eb214a8d14d 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -104,7 +104,6 @@ TEST_FILES =3D xsk_prereqs.sh $(wildcard progs/btf_dump= _test_case_*.c) # Order correspond to 'make run_tests' order TEST_PROGS :=3D test_kmod.sh \ test_lirc_mode2.sh \ - test_tc_tunnel.sh \ test_tc_edt.sh \ test_xdping.sh \ test_bpftool_build.sh \ diff --git a/tools/testing/selftests/bpf/test_tc_tunnel.sh b/tools/testing/= selftests/bpf/test_tc_tunnel.sh deleted file mode 100755 index cb55a908bb0d70c251bc55c9c8994fc023d44f64..000000000000000000000000000= 0000000000000 --- a/tools/testing/selftests/bpf/test_tc_tunnel.sh +++ /dev/null @@ -1,320 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0 -# -# In-place tunneling - -BPF_FILE=3D"test_tc_tunnel.bpf.o" -# must match the port that the bpf program filters on -readonly port=3D8000 - -readonly ns_prefix=3D"ns-$$-" -readonly ns1=3D"${ns_prefix}1" -readonly ns2=3D"${ns_prefix}2" - -readonly ns1_v4=3D192.168.1.1 -readonly ns2_v4=3D192.168.1.2 -readonly ns1_v6=3Dfd::1 -readonly ns2_v6=3Dfd::2 - -# Must match port used by bpf program -readonly udpport=3D5555 -# MPLSoverUDP -readonly mplsudpport=3D6635 -readonly mplsproto=3D137 - -readonly infile=3D"$(mktemp)" -readonly outfile=3D"$(mktemp)" - -setup() { - ip netns add "${ns1}" - ip netns add "${ns2}" - - ip link add dev veth1 mtu 1500 netns "${ns1}" type veth \ - peer name veth2 mtu 1500 netns "${ns2}" - - ip netns exec "${ns1}" ethtool -K veth1 tso off - - ip -netns "${ns1}" link set veth1 up - ip -netns "${ns2}" link set veth2 up - - ip -netns "${ns1}" -4 addr add "${ns1_v4}/24" dev veth1 - ip -netns "${ns2}" -4 addr add "${ns2_v4}/24" dev veth2 - ip -netns "${ns1}" -6 addr add "${ns1_v6}/64" dev veth1 nodad - ip -netns "${ns2}" -6 addr add "${ns2_v6}/64" dev veth2 nodad - - # clamp route to reserve room for tunnel headers - ip -netns "${ns1}" -4 route flush table main - ip -netns "${ns1}" -6 route flush table main - ip -netns "${ns1}" -4 route add "${ns2_v4}" mtu 1450 dev veth1 - ip -netns "${ns1}" -6 route add "${ns2_v6}" mtu 1430 dev veth1 - - sleep 1 - - dd if=3D/dev/urandom of=3D"${infile}" bs=3D"${datalen}" count=3D1 status= =3Dnone -} - -cleanup() { - ip netns del "${ns2}" - ip netns del "${ns1}" - - if [[ -f "${outfile}" ]]; then - rm "${outfile}" - fi - if [[ -f "${infile}" ]]; then - rm "${infile}" - fi - - if [[ -n $server_pid ]]; then - kill $server_pid 2> /dev/null - fi -} - -server_listen() { - ip netns exec "${ns2}" nc "${netcat_opt}" -l "${port}" > "${outfile}" & - server_pid=3D$! -} - -client_connect() { - ip netns exec "${ns1}" timeout 2 nc "${netcat_opt}" -w 1 "${addr2}" "${po= rt}" < "${infile}" - echo $? -} - -verify_data() { - wait "${server_pid}" - server_pid=3D - # sha1sum returns two fields [sha1] [filepath] - # convert to bash array and access first elem - insum=3D($(sha1sum ${infile})) - outsum=3D($(sha1sum ${outfile})) - if [[ "${insum[0]}" !=3D "${outsum[0]}" ]]; then - echo "data mismatch" - exit 1 - fi -} - -wait_for_port() { - for i in $(seq 20); do - if ip netns exec "${ns2}" ss ${2:--4}OHntl | grep -q "$1"; then - return 0 - fi - sleep 0.1 - done - return 1 -} - -set -e - -# no arguments: automated test, run all -if [[ "$#" -eq "0" ]]; then - echo "ipip" - $0 ipv4 ipip none 100 - - echo "ipip6" - $0 ipv4 ipip6 none 100 - - echo "ip6ip6" - $0 ipv6 ip6tnl none 100 - - echo "sit" - $0 ipv6 sit none 100 - - echo "ip4 vxlan" - $0 ipv4 vxlan eth 2000 - - echo "ip6 vxlan" - $0 ipv6 ip6vxlan eth 2000 - - for mac in none mpls eth ; do - echo "ip gre $mac" - $0 ipv4 gre $mac 100 - - echo "ip6 gre $mac" - $0 ipv6 ip6gre $mac 100 - - echo "ip gre $mac gso" - $0 ipv4 gre $mac 2000 - - echo "ip6 gre $mac gso" - $0 ipv6 ip6gre $mac 2000 - - echo "ip udp $mac" - $0 ipv4 udp $mac 100 - - echo "ip6 udp $mac" - $0 ipv6 ip6udp $mac 100 - - echo "ip udp $mac gso" - $0 ipv4 udp $mac 2000 - - echo "ip6 udp $mac gso" - $0 ipv6 ip6udp $mac 2000 - done - - echo "OK. All tests passed" - exit 0 -fi - -if [[ "$#" -ne "4" ]]; then - echo "Usage: $0" - echo " or: $0 " - exit 1 -fi - -case "$1" in -"ipv4") - readonly addr1=3D"${ns1_v4}" - readonly addr2=3D"${ns2_v4}" - readonly ipproto=3D4 - readonly netcat_opt=3D-${ipproto} - readonly foumod=3Dfou - readonly foutype=3Dipip - readonly fouproto=3D4 - readonly fouproto_mpls=3D${mplsproto} - readonly gretaptype=3Dgretap - ;; -"ipv6") - readonly addr1=3D"${ns1_v6}" - readonly addr2=3D"${ns2_v6}" - readonly ipproto=3D6 - readonly netcat_opt=3D-${ipproto} - readonly foumod=3Dfou6 - readonly foutype=3Dip6tnl - readonly fouproto=3D"41 -6" - readonly fouproto_mpls=3D"${mplsproto} -6" - readonly gretaptype=3Dip6gretap - ;; -*) - echo "unknown arg: $1" - exit 1 - ;; -esac - -readonly tuntype=3D$2 -readonly mac=3D$3 -readonly datalen=3D$4 - -echo "encap ${addr1} to ${addr2}, type ${tuntype}, mac ${mac} len ${datale= n}" - -trap cleanup EXIT - -setup - -# basic communication works -echo "test basic connectivity" -server_listen -wait_for_port ${port} ${netcat_opt} -client_connect -verify_data - -# clientside, insert bpf program to encap all TCP to port ${port} -# client can no longer connect -ip netns exec "${ns1}" tc qdisc add dev veth1 clsact -ip netns exec "${ns1}" tc filter add dev veth1 egress \ - bpf direct-action object-file ${BPF_FILE} \ - section "encap_${tuntype}_${mac}" -echo "test bpf encap without decap (expect failure)" -server_listen -wait_for_port ${port} ${netcat_opt} -! client_connect - -if [[ "$tuntype" =3D~ "udp" ]]; then - # Set up fou tunnel. - ttype=3D"${foutype}" - targs=3D"encap fou encap-sport auto encap-dport $udpport" - # fou may be a module; allow this to fail. - modprobe "${foumod}" ||true - if [[ "$mac" =3D=3D "mpls" ]]; then - dport=3D${mplsudpport} - dproto=3D${fouproto_mpls} - tmode=3D"mode any ttl 255" - else - dport=3D${udpport} - dproto=3D${fouproto} - fi - ip netns exec "${ns2}" ip fou add port $dport ipproto ${dproto} - targs=3D"encap fou encap-sport auto encap-dport $dport" -elif [[ "$tuntype" =3D~ "gre" && "$mac" =3D=3D "eth" ]]; then - ttype=3D$gretaptype -elif [[ "$tuntype" =3D~ "vxlan" && "$mac" =3D=3D "eth" ]]; then - ttype=3D"vxlan" - targs=3D"id 1 dstport 8472 udp6zerocsumrx" -elif [[ "$tuntype" =3D=3D "ipip6" ]]; then - ttype=3D"ip6tnl" - targs=3D"" -else - ttype=3D$tuntype - targs=3D"" -fi - -# tunnel address family differs from inner for SIT -if [[ "${tuntype}" =3D=3D "sit" ]]; then - link_addr1=3D"${ns1_v4}" - link_addr2=3D"${ns2_v4}" -elif [[ "${tuntype}" =3D=3D "ipip6" ]]; then - link_addr1=3D"${ns1_v6}" - link_addr2=3D"${ns2_v6}" -else - link_addr1=3D"${addr1}" - link_addr2=3D"${addr2}" -fi - -# serverside, insert decap module -# server is still running -# client can connect again -ip netns exec "${ns2}" ip link add name testtun0 type "${ttype}" \ - ${tmode} remote "${link_addr1}" local "${link_addr2}" $targs - -expect_tun_fail=3D0 - -if [[ "$tuntype" =3D=3D "ip6udp" && "$mac" =3D=3D "mpls" ]]; then - # No support for MPLS IPv6 fou tunnel; expect failure. - expect_tun_fail=3D1 -elif [[ "$tuntype" =3D~ "udp" && "$mac" =3D=3D "eth" ]]; then - # No support for TEB fou tunnel; expect failure. - expect_tun_fail=3D1 -elif [[ "$tuntype" =3D~ (gre|vxlan) && "$mac" =3D=3D "eth" ]]; then - # Share ethernet address between tunnel/veth2 so L2 decap works. - ethaddr=3D$(ip netns exec "${ns2}" ip link show veth2 | \ - awk '/ether/ { print $2 }') - ip netns exec "${ns2}" ip link set testtun0 address $ethaddr -elif [[ "$mac" =3D=3D "mpls" ]]; then - modprobe mpls_iptunnel ||true - modprobe mpls_gso ||true - ip netns exec "${ns2}" sysctl -qw net.mpls.platform_labels=3D65536 - ip netns exec "${ns2}" ip -f mpls route add 1000 dev lo - ip netns exec "${ns2}" ip link set lo up - ip netns exec "${ns2}" sysctl -qw net.mpls.conf.testtun0.input=3D1 - ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.lo.rp_filter=3D0 -fi - -# Because packets are decapped by the tunnel they arrive on testtun0 from -# the IP stack perspective. Ensure reverse path filtering is disabled -# otherwise we drop the TCP SYN as arriving on testtun0 instead of the -# expected veth2 (veth2 is where 192.168.1.2 is configured). -ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.rp_filter=3D0 -# rp needs to be disabled for both all and testtun0 as the rp value is -# selected as the max of the "all" and device-specific values. -ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.testtun0.rp_filter=3D0 -ip netns exec "${ns2}" ip link set dev testtun0 up -if [[ "$expect_tun_fail" =3D=3D 1 ]]; then - # This tunnel mode is not supported, so we expect failure. - echo "test bpf encap with tunnel device decap (expect failure)" - ! client_connect -else - echo "test bpf encap with tunnel device decap" - client_connect - verify_data - server_listen - wait_for_port ${port} ${netcat_opt} -fi - -# serverside, use BPF for decap -ip netns exec "${ns2}" ip link del dev testtun0 -ip netns exec "${ns2}" tc qdisc add dev veth2 clsact -ip netns exec "${ns2}" tc filter add dev veth2 ingress \ - bpf direct-action object-file ${BPF_FILE} section decap -echo "test bpf encap with bpf decap" -client_connect -verify_data - -echo OK --=20 2.51.0