From patchwork Mon Jan 29 07:09:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13535044 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 17A3F4EB58; Mon, 29 Jan 2024 07:09:24 +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=1706512165; cv=none; b=dDI1/ZmaNMB2v4jq5b5opLyp8QSfBYGAIjT9cVmDYoRm1pHDXfllqa5Vq4Z9D3euyUKWnrxTgDtMxoW2n44rzNAS8dxlSIebz0jlKD7X27tTPg05gfHtq9PdCxx0hsfgRc+ZoZfN+DPHKlDiNCtOuQgZZzDgqOniwUgp4pAm+RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512165; c=relaxed/simple; bh=YN/crB8LXrIiJ4ypxDLISY5HQ8ZJ79SkHHrUg38rISE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BL/snZEoS/KW9RvLB2A4YVDlyXBP+BE1Ur9yoRQ48WuyiEwfitUFVBqpq4GMpzp9rj04KuRwDc2pnODhovVLi1HH13ts+Tt7KAA06y3JdOIPxmZMxa5PcD2Z/FYv4dSryV8pTq4EfXv11nwhxigOJ+JM2Pn6J6OONPDGqljOi7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QAOlWLGk; 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="QAOlWLGk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F4DBC433C7; Mon, 29 Jan 2024 07:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706512164; bh=YN/crB8LXrIiJ4ypxDLISY5HQ8ZJ79SkHHrUg38rISE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAOlWLGkEeJSt0RqzPRrqaMZ5fLudUlowqKTETIf9YdpFCbs3/TugY3JUa20nzFHD fkPWs/f/CrmJztM0AC3JWbXTQS0Lqzuge9rphGSQyABt1M0KZEv+FxTLLVixVpYq87 TwdDHEY7pHjoy+EpEGNg3/dGMiYSNP+Xg1zaPG9O4r9YjzmqJcUeICIrKyOiLsTuBE GcMuOGXp8sFGtRWeq6DPKY5rdo+gAZQnfjDPc1Kw0GBWqkTrqB7Pd0ANSRH74EvUuZ C+nxwdaBs131PqUFXOCtTG+hzIuzV6oou5f1ksVczaiKG9GfOREOsqmshT4NF+Kdnf 9B+sWmvLv5JBQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v4 1/3] selftests/bpf: Remove incorrect object path Date: Mon, 29 Jan 2024 08:09:14 +0100 Message-Id: <20240129070916.1639008-2-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240129070916.1639008-1-bjorn@kernel.org> References: <20240129070916.1639008-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Björn Töpel The glob path, progs/*.bpf.o, is no longer a correct path. The BPF object files reside in the top directory, or in the per-flavor directory (e.g. cpuv4). Remove the incorrect object path. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index fd15017ed3b1..830a34f0aa37 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -612,8 +612,7 @@ TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ $(OUTPUT)/uprobe_multi \ ima_setup.sh \ verify_sig_setup.sh \ - $(wildcard progs/btf_dump_test_case_*.c) \ - $(wildcard progs/*.bpf.o) + $(wildcard progs/btf_dump_test_case_*.c) TRUNNER_BPF_BUILD_RULE := CLANG_BPF_BUILD_RULE TRUNNER_BPF_CFLAGS := $(BPF_CFLAGS) $(CLANG_CFLAGS) -DENABLE_ATOMICS_TESTS $(eval $(call DEFINE_TEST_RUNNER,test_progs)) From patchwork Mon Jan 29 07:09:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13535045 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 52FEF51C30; Mon, 29 Jan 2024 07:09:27 +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=1706512167; cv=none; b=cobYvNqCNf0C3P89tIg32jQiCqpaXdJ2dY9RGr+vm3/Kxtg8yfxFiFjAIUkI4WY+PK0HfC13/pjZuTfCjHMXL5rLlDcZope8+9sQplxes3tGECxTAdRtrhuvUPmqKRPU4tEVHcI+ya8hijhTuXTqAQ6CoyYEeOIiGvu/IQyZzac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512167; c=relaxed/simple; bh=JtYKGXPxAZKfTh92wrNBh/LSJK6mCdpFeDczxNfiSOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ST6GMOtTebDJs9C4E0JgOOpnrrXnkLYdDZGDEyu9DGQkeF5QYCGVVR9PmF7tLg6YNQuOYv1F0Gpz9w5NH7sUWG7LL42LFnQRdb5hOmsPi48SsxwyvubZ147XI5gaDizJF7G4uxv1WFoddxzPVWMqE7EOpQG+Q+KQWmAeqVd/qGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tl2HRExV; 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="tl2HRExV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E60CBC433F1; Mon, 29 Jan 2024 07:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706512166; bh=JtYKGXPxAZKfTh92wrNBh/LSJK6mCdpFeDczxNfiSOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tl2HRExVsGzGPWAmFGvfJYH2Ip1vQANmOLZmWQcdYuogKUkJ9fLwruHzssCzwT+KQ A2lfr2Q5n4knZg9maRl/mL58NPSWRrdoy1tvO/ftnUoFMO1NAb2ZOeyytE2tTPembM j15b1471fWKOI/l/AsagqQ9r5IJdYsRkX+Z9uA2WJIFql5PS+TcIdaHM6TFAWMMyQf 7zDvwJMvMClGfhFABbHvhf0Xi84Q+Zv1gwMaNp+/zPkOIZ6WUy9hXbJAsl1AlpENsQ UqPiH0EY60tHy96MJGfITW9UjqenTuEqbWr0nLiwmH3KFx362NvWbUKSi4aXpCQM/Y O3pBiizlOEU8w== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v4 2/3] selftests/bpf: Make install target copy test_progs extra files Date: Mon, 29 Jan 2024 08:09:15 +0100 Message-Id: <20240129070916.1639008-3-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240129070916.1639008-1-bjorn@kernel.org> References: <20240129070916.1639008-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Björn Töpel Currently, "make install" does not install the required test_progs "extra files" (e.g. kernel modules, helper shell scripts, etc.) for the BPF machine flavors (e.g. cpuv4). Add the missing "extra files" dependencies to rsync, called from the install target. Unfortunately, kselftest does not use bash as the default shell, so the globbering is limited. Blindly enabling "SHELL:=/bin/bash" for the Makefile breaks in other places. Workaround by explicitly call "/bin/bash" to expand the file globbing. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 830a34f0aa37..c3c5b85f7dae 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -605,14 +605,15 @@ TRUNNER_EXTRA_SOURCES := test_progs.c \ json_writer.c \ flow_dissector_load.h \ ip_check_defrag_frags.h -TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ - $(OUTPUT)/liburandom_read.so \ - $(OUTPUT)/xdp_synproxy \ - $(OUTPUT)/sign-file \ - $(OUTPUT)/uprobe_multi \ - ima_setup.sh \ - verify_sig_setup.sh \ - $(wildcard progs/btf_dump_test_case_*.c) +TRUNNER_PROGS_EXTRA_FILES:= $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ + $(OUTPUT)/liburandom_read.so \ + $(OUTPUT)/xdp_synproxy \ + $(OUTPUT)/sign-file \ + $(OUTPUT)/uprobe_multi \ + ima_setup.sh \ + verify_sig_setup.sh \ + $(wildcard progs/btf_dump_test_case_*.c) +TRUNNER_EXTRA_FILES := $(TRUNNER_PROGS_EXTRA_FILES) TRUNNER_BPF_BUILD_RULE := CLANG_BPF_BUILD_RULE TRUNNER_BPF_CFLAGS := $(BPF_CFLAGS) $(CLANG_CFLAGS) -DENABLE_ATOMICS_TESTS $(eval $(call DEFINE_TEST_RUNNER,test_progs)) @@ -740,11 +741,17 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ # Delete partially updated (corrupted) files on error .DELETE_ON_ERROR: +space := $(subst ,, ) +comma := , +EXTRA_FILES_GLOB := {$(subst $(space),$(comma),$(notdir $(TRUNNER_PROGS_EXTRA_FILES)))} DEFAULT_INSTALL_RULE := $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - @for DIR in $(TEST_INST_SUBDIRS); do \ - mkdir -p $(INSTALL_PATH)/$$DIR; \ - rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR;\ + @for DIR in $(TEST_INST_SUBDIRS); do \ + mkdir -p $(INSTALL_PATH)/$$DIR; \ + rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR; \ + rsync -a --copy-unsafe-links \ + $$(/bin/bash -c "echo $(OUTPUT)/$$DIR/$(EXTRA_FILES_GLOB)") \ + $(INSTALL_PATH)/$$DIR; \ done endef From patchwork Mon Jan 29 07:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13535046 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 5FD1D524C4; Mon, 29 Jan 2024 07:09:29 +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=1706512169; cv=none; b=QbPRs3C/KsfzZJFv7Macmt/SC8W8YPcLAjjQX0Q4ziIrT+H4Eox7JxXB0wNimTUh3c2872ci4QjkkSzK3ciJwvPdt6QAXFfLaPgtbwc8WMQ0cdRxFtwUKdN1TZgMeRRLui49NMnUUXYZAwshqrf1i66xRerdvU1LtvMKtSfcsvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512169; c=relaxed/simple; bh=+381f8EYJCTjcjt+MiKdcCGuBgs7cYIbIsmEKIv6bds=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=pzzK3zYhEHS2sVDyaoFpobsNR+jeB80a7YzNlt93EqY3JS6Yx7SkhQDoynu4JT1QbkgxiGELQ1y3Jmr1RTh8hubQWUycWRV3wXFc+fMsSV21ul+xzhdAOTji7px4c6K1wvx0/2QfoeRMTWtA9obC++WDzcfa6jC80S+eiMVyOUg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ca/26MDX; 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="Ca/26MDX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5156FC433C7; Mon, 29 Jan 2024 07:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706512169; bh=+381f8EYJCTjcjt+MiKdcCGuBgs7cYIbIsmEKIv6bds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ca/26MDX4T/qszXOnPWX+m9GqFZsM18y4JA1KnQWXSXupaLCKI1qdWuGvdVN76JvZ zxImdfunMgPvV1te6RmXlRfKw4fXBJMtYFrl7Y9Sq8Fsoenqu3ExYltmw88WJce9ZR drKd9EFeBwUYI90d6LY3ZNCe7t2e9hN8TIMoIDOekx6NBwmBuK28soIdCj7yjrFfnG sSfjpycIayicI+S89BGnycL/m+9Fe93O2ASGaITdQBnmbt6ldOxu+HHaCjMl6wRXrM AxfeOLBRYX2XuCdSYSI4kuNTsBK0mpSxXAGhXV8oQwJnoKXGR3N2G4Oa7UKtadh8lf T/GoWeaLgUKnA== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v4 3/3] selftests/bpf: Make install target copy bpftool Date: Mon, 29 Jan 2024 08:09:16 +0100 Message-Id: <20240129070916.1639008-4-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240129070916.1639008-1-bjorn@kernel.org> References: <20240129070916.1639008-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Björn Töpel bpftool is required for some test_progs tests. Make sure it is installed as part of the install target. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index c3c5b85f7dae..ebbb40ef5702 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -749,8 +749,9 @@ override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) @for DIR in $(TEST_INST_SUBDIRS); do \ mkdir -p $(INSTALL_PATH)/$$DIR; \ - rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR; \ rsync -a --copy-unsafe-links \ + $(OUTPUT)/$$DIR/*.bpf.o \ + $(OUTPUT)/$$DIR/bpftool \ $$(/bin/bash -c "echo $(OUTPUT)/$$DIR/$(EXTRA_FILES_GLOB)") \ $(INSTALL_PATH)/$$DIR; \ done