From patchwork Fri Feb 28 21:29:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 13997162 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 90DA31D14FF; Fri, 28 Feb 2025 21:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740778198; cv=none; b=d0QcjR3FJuYds71APuUqJpYA6N3aG1jcYL4VRDoXI8QHxoh4OyWpI9MG9/iNyLiX0FTobFLy9DeVHvSVfzYjAbvtDebSVcQtxH3ZgFgfVbgkmHRe8WEkvkXAgPaVwUAcrAoBvud1XeJSnugR5Yke3NCfsI+ZuiZmdgprfC3BRMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740778198; c=relaxed/simple; bh=QVacNK0VfwGfBYgf6+cNqR3ILRAT0XnGeT1FfHRn84k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qgj1VCl7WwyGvEohNHX2Qb9/Wf9sNcfukLiPWCrxWotmewo2IVzmgA9jDDFtlt7vS/lCwX3Upk42wiIJxFKd5onBVU5699gcLrquKozOrsdMB4hu1gfN/FARKV9WPw/nejOoV5r5RhRWZ0lU52b79aSKmNcnFcQHq2kgLX0BcWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aAJ8VCOy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aAJ8VCOy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE96BC4CED6; Fri, 28 Feb 2025 21:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740778198; bh=QVacNK0VfwGfBYgf6+cNqR3ILRAT0XnGeT1FfHRn84k=; h=From:To:Cc:Subject:Date:From; b=aAJ8VCOyUqwNiUR6QKk6vYa+tjp//zDE0SD/net1P0oW0eEO1XbheBAk9JdFw+OHc yjNCrn8aqYQytRUlVL/WJH/gCZqHL4jb9HpDCvOkez8ihgwtgXw0REuJsfJ25Hcbqe Djs46as1MR+TVNH4s5KiEBXo5IialDP/YCDX6J0u8aVz8QdidEyfK15I7XtMe27T6L 8NZFyCt0J/DlHRMI8YSc0Jl6aS+W77ddq/gaCWy095QByGHjUxMAx5kK4mmdgPu/82 67eKu0bq0YON0Ed3NUNvXmY06yCgwQV8RYIUf8DFR/+ceO2PKiYaW0hUHllD3WfwL8 0eCsS8C+oMLew== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 1/2] selftests: drv-net: use env.rpath in the HDS test Date: Fri, 28 Feb 2025 13:29:55 -0800 Message-ID: <20250228212956.25399-1-kuba@kernel.org> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Commit 29b036be1b0b ("selftests: drv-net: test XDP, HDS auto and the ioctl path") added a new test case in the net tree, now that this code has made its way to net-next convert it to use the env.rpath() helper instead of manually computing the relative path. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/hds.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hds.py b/tools/testing/selftests/drivers/net/hds.py index 873f5219e41d..7cc74faed743 100755 --- a/tools/testing/selftests/drivers/net/hds.py +++ b/tools/testing/selftests/drivers/net/hds.py @@ -20,8 +20,7 @@ from lib.py import defer, ethtool, ip def _xdp_onoff(cfg): - test_dir = os.path.dirname(os.path.realpath(__file__)) - prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" + prog = cfg.rpath("../../net/lib/xdp_dummy.bpf.o") ip("link set dev %s xdp obj %s sec xdp" % (cfg.ifname, prog)) ip("link set dev %s xdp off" % cfg.ifname) From patchwork Fri Feb 28 21:29:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 13997163 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DA0E91D88AC; Fri, 28 Feb 2025 21:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740778198; cv=none; b=KYL103KUajO8NAalJPjiWe2gLXn3b1FLP73430bod6LCLGrF1dF4AOiLB36x9YF/uqWJMl0W3R7V/46fO+zoQNyv/WFmwn4JdWytvj7O890UKi3W072Oe6nco2TdiqnSuzPMzMkkQAYBJwtQtgjf1ruBHdn6ooTF87GqqcNXltE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740778198; c=relaxed/simple; bh=i+yZq5ChfJhwnmcYfNQxS0k8esgJ9UtledrEVvce07w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jA6NSSUYZdLyIJpMimOxFtX+6rk0JogXr0YqfXjE0wIcZqQ8IkTmIEF5aac4BAAf2IBM2SRhXsdyaPPWA39JtQzfgViSalpp5qQhAIyodhLRGY8sL5fRFES1jGHmg7cXL5nQMWEmzoLuy5szhac49vfczZBdbVlv68hWVz2sGnI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fomKJQVR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fomKJQVR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26447C4CEE9; Fri, 28 Feb 2025 21:29:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740778198; bh=i+yZq5ChfJhwnmcYfNQxS0k8esgJ9UtledrEVvce07w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fomKJQVRh8xpKDeE43TqX5Sxi+95UjLm9Cze5Acn64w/VUZnxwmlZl7O8hACbACSc RvyzcO+pVSt76SrA1GXSZgI7sNB/MFRtJ2fqzxKlZ1XeheLz0+7gW1qc8JlHrGhzbs LCee/HcxTF7NM1eixlaE5ZlbDR4BGyKdg1ljpCw5UHO/7v8hYWV3veG924S+Yh04CW btJOevpuR59bJgDHBbUX5G/7jL7iFrwmpQjd3gHKzHZNmckc2PXm2rbIfPEqsFhMEa ElOT4j3XyQ66cEcVAhLh2vryEXRs70cHkvNasetn9zNVam9Xi+WI2Ks1S+YbPSRqzY Tdf9aUYOJazPw== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 2/2] selftests: net: use the dummy bpf from net/lib Date: Fri, 28 Feb 2025 13:29:56 -0800 Message-ID: <20250228212956.25399-2-kuba@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250228212956.25399-1-kuba@kernel.org> References: <20250228212956.25399-1-kuba@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Commit 29b036be1b0b ("selftests: drv-net: test XDP, HDS auto and the ioctl path") added an sample XDP_PASS prog in net/lib, so that we can reuse it in various sub-directories. Delete the old sample and use the one from the lib in existing tests. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/xdp_dummy.bpf.c | 13 ------------- tools/testing/selftests/net/udpgro_bench.sh | 2 +- tools/testing/selftests/net/udpgro_frglist.sh | 2 +- tools/testing/selftests/net/udpgro_fwd.sh | 2 +- tools/testing/selftests/net/veth.sh | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 tools/testing/selftests/net/xdp_dummy.bpf.c diff --git a/tools/testing/selftests/net/xdp_dummy.bpf.c b/tools/testing/selftests/net/xdp_dummy.bpf.c deleted file mode 100644 index d988b2e0cee8..000000000000 --- a/tools/testing/selftests/net/xdp_dummy.bpf.c +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#define KBUILD_MODNAME "xdp_dummy" -#include -#include - -SEC("xdp") -int xdp_dummy_prog(struct xdp_md *ctx) -{ - return XDP_PASS; -} - -char _license[] SEC("license") = "GPL"; diff --git a/tools/testing/selftests/net/udpgro_bench.sh b/tools/testing/selftests/net/udpgro_bench.sh index c51ea90a1395..815fad8c53a8 100755 --- a/tools/testing/selftests/net/udpgro_bench.sh +++ b/tools/testing/selftests/net/udpgro_bench.sh @@ -7,7 +7,7 @@ source net_helper.sh readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" -BPF_FILE="xdp_dummy.bpf.o" +BPF_FILE="lib/xdp_dummy.bpf.o" cleanup() { local -r jobs="$(jobs -p)" diff --git a/tools/testing/selftests/net/udpgro_frglist.sh b/tools/testing/selftests/net/udpgro_frglist.sh index 17404f49cdb6..5f3d1a110d11 100755 --- a/tools/testing/selftests/net/udpgro_frglist.sh +++ b/tools/testing/selftests/net/udpgro_frglist.sh @@ -7,7 +7,7 @@ source net_helper.sh readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" -BPF_FILE="xdp_dummy.bpf.o" +BPF_FILE="lib/xdp_dummy.bpf.o" cleanup() { local -r jobs="$(jobs -p)" diff --git a/tools/testing/selftests/net/udpgro_fwd.sh b/tools/testing/selftests/net/udpgro_fwd.sh index 550d8eb3e224..f22f6c66997e 100755 --- a/tools/testing/selftests/net/udpgro_fwd.sh +++ b/tools/testing/selftests/net/udpgro_fwd.sh @@ -3,7 +3,7 @@ source net_helper.sh -BPF_FILE="xdp_dummy.bpf.o" +BPF_FILE="lib/xdp_dummy.bpf.o" readonly BASE="ns-$(mktemp -u XXXXXX)" readonly SRC=2 readonly DST=1 diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh index 6bb7dfaa30b6..9709dd067c72 100755 --- a/tools/testing/selftests/net/veth.sh +++ b/tools/testing/selftests/net/veth.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -BPF_FILE="xdp_dummy.bpf.o" +BPF_FILE="lib/xdp_dummy.bpf.o" readonly STATS="$(mktemp -p /tmp ns-XXXXXX)" readonly BASE=`basename $STATS` readonly SRC=2