From nobody Tue Feb 10 00:43:33 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 103702F1FCF; Fri, 31 Oct 2025 15:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926134; cv=none; b=JbLAoqkG+49D/SryB+DSrJZ4JxHs+IIiEg7HMt3v9PqFx0Y2+HUdz8K3b1SYfxxN3LxuBLjixinc66HunuvGAoCXgYDhw2wcBvwrfbKfNJT71LlEafBqmIl4DXfdcB48I66CrhFa1x4OeG9I6iZ5R7PUSZe4XSQR5UINRk515fk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926134; c=relaxed/simple; bh=FlMQW/zdoeUwy361J2x3EnxoLoLiW3cy367tB6TXpLQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ueFaL8nvNOK7KsOhF1nPiIIqutp0S5BVr9U0qwiXFL8s/yEy1ost4PZ43o3L5RgjZSoB+WCoBy6RVsFCg4I9PHchcylx+BOnoY6fVDSCGCF13Ozkw/0GNWrxSK9iMa7kaV550enEfYGDHC0+0zu1s7Rw9gjDd/54tbeQpm1nNz4= 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=duc4OLqZ; arc=none smtp.client-ip=185.171.202.116 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="duc4OLqZ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id F12F7C0E95A; Fri, 31 Oct 2025 15:55:09 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 801B560704; Fri, 31 Oct 2025 15:55:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 89C8311818064; Fri, 31 Oct 2025 16:55:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761926129; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=lTXyjSXSIjBvnWIvqP/bdwEhFOhi3TM275wXbjbaKaI=; b=duc4OLqZwkstgkZTRIsgkmIdBJeMxXGXQth5UyQ2BYkGKD/B+RQ2J5NcM5ayGgUz0QvWri JyYixFKKmf+uwkDYmoTvQjSgXXUrOGDxf8v4eyswz37Hii9aX+bnAvKQmDFuEm68Nw/Phb IsiQ1IIkUyR/U6mZbo79Sj77CeNx3IIiBsOgQsNrB1CcA/mSoVO5HMEcJFB/nZXkzw33AR 7uqzZBp+4nkpQRor+ME3iq08AbHZNKQhcuto3FQrL2vyFEncxd1FPxnlgvU1B16U4A8YEQ Zv5C7NE6eIacGR8OkZSEgHjO4Xpf4Pr2YQW65tqEWziTI/x2vXYfK/YVy6cyoA== From: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= Date: Fri, 31 Oct 2025 16:55:15 +0100 Subject: [PATCH bpf-next 3/4] selftests/bpf: remove test_tc_edt.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: <20251031-tc_edt-v1-3-5d34a5823144@bootlin.com> References: <20251031-tc_edt-v1-0-5d34a5823144@bootlin.com> In-Reply-To: <20251031-tc_edt-v1-0-5d34a5823144@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, Bastien Curutchet , Thomas Petazzoni , 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.3 X-Last-TLS-Session-Version: TLSv1.3 Now that test_tc_edt has been integrated in test_progs, remove the legacy shell script. Signed-off-by: Alexis Lothor=C3=A9 (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 2 - tools/testing/selftests/bpf/test_tc_edt.sh | 100 -------------------------= ---- 2 files changed, 102 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests= /bpf/Makefile index 02981b0d9b03..8793305bcee6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -99,13 +99,11 @@ TEST_GEN_PROGS +=3D test_progs-cpuv4 TEST_INST_SUBDIRS +=3D cpuv4 endif =20 -TEST_GEN_FILES =3D test_tc_edt.bpf.o TEST_FILES =3D xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c) =20 # Order correspond to 'make run_tests' order TEST_PROGS :=3D test_kmod.sh \ test_lirc_mode2.sh \ - test_tc_edt.sh \ test_xdping.sh \ test_bpftool_build.sh \ test_bpftool.sh \ diff --git a/tools/testing/selftests/bpf/test_tc_edt.sh b/tools/testing/sel= ftests/bpf/test_tc_edt.sh deleted file mode 100755 index 8db8e146a431..000000000000 --- a/tools/testing/selftests/bpf/test_tc_edt.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0 -# -# This test installs a TC bpf program that throttles a TCP flow -# with dst port =3D 9000 down to 5MBps. Then it measures actual -# throughput of the flow. - -BPF_FILE=3D"test_tc_edt.bpf.o" -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root" - echo "FAIL" - exit 1 -fi - -# check that nc, dd, and timeout are present -command -v nc >/dev/null 2>&1 || \ - { echo >&2 "nc is not available"; exit 1; } -command -v dd >/dev/null 2>&1 || \ - { echo >&2 "nc is not available"; exit 1; } -command -v timeout >/dev/null 2>&1 || \ - { echo >&2 "timeout is not available"; exit 1; } - -readonly NS_SRC=3D"ns-src-$(mktemp -u XXXXXX)" -readonly NS_DST=3D"ns-dst-$(mktemp -u XXXXXX)" - -readonly IP_SRC=3D"172.16.1.100" -readonly IP_DST=3D"172.16.2.100" - -cleanup() -{ - ip netns del ${NS_SRC} - ip netns del ${NS_DST} -} - -trap cleanup EXIT - -set -e # exit on error - -ip netns add "${NS_SRC}" -ip netns add "${NS_DST}" -ip link add veth_src type veth peer name veth_dst -ip link set veth_src netns ${NS_SRC} -ip link set veth_dst netns ${NS_DST} - -ip -netns ${NS_SRC} addr add ${IP_SRC}/24 dev veth_src -ip -netns ${NS_DST} addr add ${IP_DST}/24 dev veth_dst - -ip -netns ${NS_SRC} link set dev veth_src up -ip -netns ${NS_DST} link set dev veth_dst up - -ip -netns ${NS_SRC} route add ${IP_DST}/32 dev veth_src -ip -netns ${NS_DST} route add ${IP_SRC}/32 dev veth_dst - -# set up TC on TX -ip netns exec ${NS_SRC} tc qdisc add dev veth_src root fq -ip netns exec ${NS_SRC} tc qdisc add dev veth_src clsact -ip netns exec ${NS_SRC} tc filter add dev veth_src egress \ - bpf da obj ${BPF_FILE} sec tc - - -# start the listener -ip netns exec ${NS_DST} bash -c \ - "nc -4 -l -p 9000 >/dev/null &" -declare -i NC_PID=3D$! -sleep 1 - -declare -ir TIMEOUT=3D20 -declare -ir EXPECTED_BPS=3D5000000 - -# run the load, capture RX bytes on DST -declare -ir RX_BYTES_START=3D$( ip netns exec ${NS_DST} \ - cat /sys/class/net/veth_dst/statistics/rx_bytes ) - -set +e -ip netns exec ${NS_SRC} bash -c "timeout ${TIMEOUT} dd if=3D/dev/zero \ - bs=3D1000 count=3D1000000 > /dev/tcp/${IP_DST}/9000 2>/dev/null" -set -e - -declare -ir RX_BYTES_END=3D$( ip netns exec ${NS_DST} \ - cat /sys/class/net/veth_dst/statistics/rx_bytes ) - -declare -ir ACTUAL_BPS=3D$(( ($RX_BYTES_END - $RX_BYTES_START) / $TIMEOUT = )) - -echo $TIMEOUT $ACTUAL_BPS $EXPECTED_BPS | \ - awk '{printf "elapsed: %d sec; bps difference: %.2f%%\n", - $1, ($2-$3)*100.0/$3}' - -# Pass the test if the actual bps is within 1% of the expected bps. -# The difference is usually about 0.1% on a 20-sec test, and =3D=3D> zero -# the longer the test runs. -declare -ir RES=3D$( echo $ACTUAL_BPS $EXPECTED_BPS | \ - awk 'function abs(x){return ((x < 0.0) ? -x : x)} - {if (abs(($1-$2)*100.0/$2) > 1.0) { print "1" } - else { print "0"} }' ) -if [ "${RES}" =3D=3D "0" ] ; then - echo "PASS" -else - echo "FAIL" - exit 1 -fi --=20 2.51.1.dirty