From patchwork Tue Jul 12 21:21:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_M=C3=BCller?= X-Patchwork-Id: 12915720 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7C20C433EF for ; Tue, 12 Jul 2022 21:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbiGLVVf (ORCPT ); Tue, 12 Jul 2022 17:21:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230302AbiGLVVe (ORCPT ); Tue, 12 Jul 2022 17:21:34 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 718B2BE0FB for ; Tue, 12 Jul 2022 14:21:33 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 24F6A240026 for ; Tue, 12 Jul 2022 23:21:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657660892; bh=xqQqHS88YPR91NCm+ghXPAvfH6r097v6TdeKSZ8kXUo=; h=From:To:Cc:Subject:Date:From; b=esQKLtmd5lvRaOa318WD2V/Dz1KBn6z9Fvr3L/4yBtSEyPGZoJPg+BWg2uY2ykodb 3u3VVhWUSw+DkIpNNgJCJJIRfe9MfLqcQWvXGsIkfmr96x/SPHcfPXPXNjLzLI/Zpt GNxxnd69nVHiRO6I24qvoAsi49L5OEVRxTuhul7KnM8Huz+mAMjvzP6qD90YSQhxZ2 ZvU4VbVFxIcmOT6upktj0YahT7J/rO2kvKji/vouzxHZz8/QNTykYcfv9AbDxBk+ZL B51x+XPH6F/2N4XzO3gBMAa8C6/tkJsw2djxTDqO4ZbmIW1f6X6tErgpGEQXSISiKI /iCR56PG9crww== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LjDG32WYtz6tm4; Tue, 12 Jul 2022 23:21:31 +0200 (CEST) From: =?utf-8?q?Daniel_M=C3=BCller?= To: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net, kernel-team@fb.com Cc: mykolal@fb.com Subject: [PATCH bpf-next 2/3] selftests/bpf: Integrate vmtest configs Date: Tue, 12 Jul 2022 21:21:23 +0000 Message-Id: <20220712212124.3180314-3-deso@posteo.net> In-Reply-To: <20220712212124.3180314-1-deso@posteo.net> References: <20220712212124.3180314-1-deso@posteo.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This change integrates the configuration from the vmtest repository [0], where it is currently used for testing kernel patches into the existing configuration pulled in with an earlier patch. The result is a super set of the configs from the two repositories. [0]: https://github.com/kernel-patches/vmtest/tree/831ee8eb72ddb7e03babb8f7e050d52a451237aa/travis-ci/vmtest/configs Signed-off-by: Daniel Müller --- tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest | 5 +++++ .../selftests/bpf/configs/denylist/DENYLIST-latest.s390x | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest b/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest index 939de574..ddf8a0c5 100644 --- a/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest +++ b/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest @@ -4,3 +4,8 @@ stacktrace_build_id_nmi stacktrace_build_id task_fd_query_rawtp varlen +btf_dump/btf_dump: syntax +kprobe_multi_test/bench_attach +core_reloc/enum64val +core_reloc/size___diff_sz +core_reloc/type_based___diff_sz diff --git a/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest.s390x b/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest.s390x index e33cab..36574b0 100644 --- a/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest.s390x +++ b/tools/testing/selftests/bpf/configs/denylist/DENYLIST-latest.s390x @@ -63,5 +63,6 @@ bpf_cookie # failed to open_and_load program: -524 xdp_do_redirect # prog_run_max_size unexpected error: -22 (errno 22) send_signal # intermittently fails to receive signal select_reuseport # intermittently fails on new s390x setup +tc_redirect/tc_redirect_dtime # very flaky xdp_synproxy # JIT does not support calling kernel function (kfunc) unpriv_bpf_disabled # fentry From patchwork Tue Jul 12 21:21:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_M=C3=BCller?= X-Patchwork-Id: 12915721 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37B23C433EF for ; Tue, 12 Jul 2022 21:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233044AbiGLVVh (ORCPT ); Tue, 12 Jul 2022 17:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232849AbiGLVVh (ORCPT ); Tue, 12 Jul 2022 17:21:37 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97C75BE0FB for ; Tue, 12 Jul 2022 14:21:35 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 44563240028 for ; Tue, 12 Jul 2022 23:21:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657660894; bh=75uv+CAVHwRQa5YiroufAwxwKrYXSIGpqf/kgRzpZ4c=; h=From:To:Cc:Subject:Date:From; b=nBlQQhhIJBPzK/H2rZZPUfnu6LNRQjXNMTH747XUn5FK8XUPzlKIxl1BXEXTVYOxn FM7wf/mQY+jeuxIlj39EcKq2GUnl9axgXjt3CnQSa/P7313bu3Ml5djfugEUYSOzei D+kKkRlLvATgKVdMaSeLMzptX+sBdzK5bbaABLxBy9gmi2cjzrpvOz/brOrV44nGut gXwSH80QXWYihkE0dOUyZpkXBUEN3VVWxKDkMOh4fpMO/cDqwE7cK/OEt7dPOFe2FP 3Nl5GEf0zHTAdtb8CLmCU5Fpm5LjD5xNMd36456mukNqoE1Di/qQWHk4CA7Zc27gXh 7NgYiAD5AJYnw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LjDG53pm9z9rxM; Tue, 12 Jul 2022 23:21:33 +0200 (CEST) From: =?utf-8?q?Daniel_M=C3=BCller?= To: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net, kernel-team@fb.com Cc: mykolal@fb.com Subject: [PATCH bpf-next 3/3] selftests/bpf: Adjust vmtest.sh to use local kernel configuration Date: Tue, 12 Jul 2022 21:21:24 +0000 Message-Id: <20220712212124.3180314-4-deso@posteo.net> In-Reply-To: <20220712212124.3180314-1-deso@posteo.net> References: <20220712212124.3180314-1-deso@posteo.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net So far the vmtest.sh script, which can be used as a convenient way to run bpf selftests, has obtained the kernel config safe to use for testing from the libbpf/libbpf GitHub repository [0]. Given that we now have included this configuration into this very repository, we can just consume it from here as well, eliminating the necessity of remote accesses. With this change we adjust the logic in the script to use the configuration from below tools/testing/selftests/bpf/configs/ instead of pulling it over the network. [0]: https://github.com/libbpf/libbpf Signed-off-by: Daniel Müller --- tools/testing/selftests/bpf/vmtest.sh | 28 ++++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh index e0bb04a..fdab48 100755 --- a/tools/testing/selftests/bpf/vmtest.sh +++ b/tools/testing/selftests/bpf/vmtest.sh @@ -30,8 +30,7 @@ DEFAULT_COMMAND="./test_progs" MOUNT_DIR="mnt" ROOTFS_IMAGE="root.img" OUTPUT_DIR="$HOME/.bpf_selftests" -KCONFIG_URL="https://raw.githubusercontent.com/libbpf/libbpf/master/travis-ci/vmtest/configs/config-latest.${ARCH}" -KCONFIG_API_URL="https://api.github.com/repos/libbpf/libbpf/contents/travis-ci/vmtest/configs/config-latest.${ARCH}" +KCONFIG_REL_PATH="tools/testing/selftests/bpf/configs/config-latest.${ARCH}" INDEX_URL="https://raw.githubusercontent.com/libbpf/ci/master/INDEX" NUM_COMPILE_JOBS="$(nproc)" LOG_FILE_BASE="$(date +"bpf_selftests.%Y-%m-%d_%H-%M-%S")" @@ -271,20 +270,17 @@ is_rel_path() update_kconfig() { - local kconfig_file="$1" - local update_command="curl -sLf ${KCONFIG_URL} -o ${kconfig_file}" - # Github does not return the "last-modified" header when retrieving the - # raw contents of the file. Use the API call to get the last-modified - # time of the kernel config and only update the config if it has been - # updated after the previously cached config was created. This avoids - # unnecessarily compiling the kernel and selftests. + local kernel_checkout="$1" + local kconfig_file="$2" + local kconfig_src="${kernel_checkout}/${KCONFIG_REL_PATH}" + local update_command="cp ${kconfig_src} ${kconfig_file}" if [[ -f "${kconfig_file}" ]]; then - local last_modified_date="$(curl -sL -D - "${KCONFIG_API_URL}" -o /dev/null | \ - grep "last-modified" | awk -F ': ' '{print $2}')" - local remote_modified_timestamp="$(date -d "${last_modified_date}" +"%s")" - local local_creation_timestamp="$(stat -c %Y "${kconfig_file}")" - - if [[ "${remote_modified_timestamp}" -gt "${local_creation_timestamp}" ]]; then + local src_modified="$(stat -c %Y "${kconfig_src}")" + local local_modified="$(stat -c %Y "${kconfig_file}")" + # Only update the config if it has been updated after the + # previously cached config was created. This avoids + # unnecessarily compiling the kernel and selftests. + if [[ "${src_modified}" -gt "${local_modified}" ]]; then ${update_command} fi else @@ -372,7 +368,7 @@ main() mkdir -p "${OUTPUT_DIR}" mkdir -p "${mount_dir}" - update_kconfig "${kconfig_file}" + update_kconfig "${kernel_checkout}" "${kconfig_file}" recompile_kernel "${kernel_checkout}" "${make_command}"