From nobody Sat Dec 14 19:12:36 2024 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 7BE4C79C4 for ; Sun, 28 Jan 2024 06:17:01 +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=1706422621; cv=none; b=LLuR+YTdnSuQBC1MTLF/TOtG5ITJfGGSwnLd8ohhavbXJ22BX2O3Y/jYCtNqZM+NFJZGpC87I3v9Ozt36D5++9XBE9dsVdivr2vUuc1+wHXTF6t6AJ57aU1UrKgQzXczkUurm3KpUBjQrzYUIKRvNBTKoG7gDQfmMVyeAPP58So= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706422621; c=relaxed/simple; bh=DHvj39LiEsJxGLeLX9iPKJtvtKLHEHZ9ALydrMAJneo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XO1ER/CFptmfABpi0B6cfXTIRc5xg+7yWkpG/3qPQeeKdF4LhlFhp4Zsk3aqGhGocLkxykbU3XjB4OIwKD41ktq7Cyu8XEa6nw/1E191NUsexHSV25PGEuPGZ9xPyH/FCEvCmm/GcTGXK4EjkaUev/TdJ6rFf8PrcMPv6VAV/yQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ULDXpwE4; 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="ULDXpwE4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C67CDC43390; Sun, 28 Jan 2024 06:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706422621; bh=DHvj39LiEsJxGLeLX9iPKJtvtKLHEHZ9ALydrMAJneo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ULDXpwE4CcOor/nLIAMNedkgT+3RxFanAZjVwtloBopvIvhYiViHuLaBoxi9MVs4e 4xkuwO3VVNbxPLtQaK4/7ZrX9Vb3XvAV8T063la5QitBOVAsEha7eSJqV8vPpmUgjk bfCRlBzqtmFIZiOlSfcNzmQXJu76VBiIzvUk1bwAAW/Tqm1aENW3LviTv0e6X/EU9a 3yNrucGFQ8Ws5P4a2/o01f2FHhZxRNNYa3RY+QQoJP5GW0f2uIXVYoZZ7uPmG++N67 5HjzbQi1U6ZDL0MOi26CT2pE1RYkuSBYMTF7luwRPRlu98q/bEhPpKSu8AgJjL0fIB 6FflZo9zu2vfg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH virtme-docker 1/3] change watchdog to device Date: Sun, 28 Jan 2024 14:16:01 +0800 Message-Id: <6732dae64a26bbbbda3d35ff29b47803a86d3983.1706422466.git.geliang@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch should be merged into virtme repo: ''' architectures: use qemu -device option Use qemu '-device' option instead of '-watchdog' to fix this error in Ubuntu 23.04: qemu-system-x86_64: -watchdog: invalid option ret =3D Arch.qemuargs(is_native) # Add a watchdog. This is useful for testing. - ret.extend(['-watchdog', 'i6300esb']) + ret.extend(['-device', 'i6300esb']) if is_native and os.access('/dev/kvm', os.R_OK): # If we're likely to use KVM, request a full-featured CPU. ''' Signed-off-by: Geliang Tang --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bf7f733..cf8c692 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,8 @@ ARG VIRTME_GIT_SHA=3D"a680c0861cf6f9dc6a8a821e9e58ae43c5e= 68435" RUN cd /opt && \ git clone "${VIRTME_GIT_URL}" && \ cd virtme && \ - git checkout "${VIRTME_GIT_SHA}" + git checkout "${VIRTME_GIT_SHA}" && \ + sed -i 's/-watchdog/-device/g' virtme/architectures.py =20 # byobu (not to have a dep to iproute2) ARG BYOBU_URL=3D"https://launchpad.net/byobu/trunk/5.133/+download/byobu_5= .133.orig.tar.gz" --=20 2.40.1 From nobody Sat Dec 14 19:12:36 2024 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 42A966FA9 for ; Sun, 28 Jan 2024 06:17:02 +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=1706422623; cv=none; b=QIoN0eRIFBebHtguAyr0bK+PcvGFnqlP7QwlThRx/XOMh5xobit2AgCrU0XTJ/yNleBrd+qvk9nuLrbWB576kO5AIxta7DCSVFKVM1GOvA2Gry+Z+Qe2a0ReGoJb4EptQGQE1GOKBnd/PpDq1iuWV1a5Vi0xn5AiHhR3r1mhJLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706422623; c=relaxed/simple; bh=IYwQgfEYenZYlUMo770sJmPpkXmlV5nnmabqrvbTs/o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QiD7EEChRYd4R4yCXuPeASiLL7IIU0SMyz9oXMU0YnJyZLtTxWhyF+2DyVZ4wYOjWzugjuy+Rp2RJFve/EmL8j+XXQzhNF9DYs36gUL4K/ftYavUFQzR3t6CY6Qye1Pnnvzc7sV6GMITA322Tf8tVtNXvr/O9JGjEC4YRAgtE9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UvJpFMt9; 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="UvJpFMt9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A019DC433C7; Sun, 28 Jan 2024 06:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706422622; bh=IYwQgfEYenZYlUMo770sJmPpkXmlV5nnmabqrvbTs/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvJpFMt9ViiXSRwYCcG1OdDmJ16fmZIH8PSs29znN1Xs8cVMMW4kO3g+9t7IRC6ET 455vUuk7TdsdlsScPesj4HpHMhNJViYl0r9RLaUiOk9IS+5lmCOmdIRrielqytr6ke lyFW6iQRTgaPf/imtCBmcoYJyqvaYpx8jCcMNzHi8notdw4E1xPbcjnzVOalP2oei/ gdB+tffuz6kAryzQLZDVCgWd+/s+sSEOTrAjVrcTUhLB7HEdq1CZMxCq93WwSTrtSs N1wSNDvIdWORJAMtgdZuTdF4SY6gf2i/06QdpvLwVd6z7mE4RiYWm+EO8C/GOlLkbC 0mbJZ67yK/SRQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH virtme-docker 2/3] upgrade to ubuntu 23.10 Date: Sun, 28 Jan 2024 14:16:02 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There will be many build errors when comliling bpf selftests under Ubuntu 22.04. Upgrade to 23.10 to use the new versions of gcc, clang and LLVM. Fix sparse build errors for llvm-16. This part alse be sent to sparse upstream. It can be dropped from this patch when accepted. Signed-off-by: Geliang Tang --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cf8c692..cbc11f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:23.10 =20 LABEL name=3Dmptcp-upstream-virtme-docker =20 @@ -71,6 +71,10 @@ ARG SPARSE_GIT_SHA=3D"ce1a6720f69e6233ec9abd4e9aae5945e0= 5fda41" # include a fix fo RUN cd /opt && \ git clone "${SPARSE_GIT_URL}" sparse && \ cd "sparse" && \ + sed -i 's/LLVMConstGEP(/LLVMConstGEP2(type, /g' sparse-llvm.c && \ + sed -i 's/LLVMBuildInBoundsGEP(builder/LLVMBuildInBoundsGEP2(builder, ty= pe/g' sparse-llvm.c && \ + sed -i 's/LLVMBuildLoad(fn->builder/LLVMBuildLoad2(fn->builder, insn_sym= bol_type(insn)/g' sparse-llvm.c && \ + sed -i 's/LLVMBuildCall(fn->builder/LLVMBuildCall2(fn->builder, insn_sym= bol_type(insn)/g' sparse-llvm.c && \ make -j"$(nproc)" -l"$(nproc)" && \ make PREFIX=3D/usr install && \ cd .. && \ --=20 2.40.1 From nobody Sat Dec 14 19:12:36 2024 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 015D679C4 for ; Sun, 28 Jan 2024 06:17:04 +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=1706422625; cv=none; b=VMeNyFXaSF4VaR1VhuI1RqjQwND0wvK8+6eC6Jnuf30EfbyS/EnSdSWR/Ss2OpIm9pOLO5GopXs+NffVHV2VnbGRy8s2Sbz6TzK/Tpq/GHVSER4VIyGVcNPYKNaxOgvpAYOMnrPvBzSrMh8ZtZhAEukXecalEZZzi1GfXlc+fwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706422625; c=relaxed/simple; bh=A/0GwukbZBKghfdjBoa3UB1juDL1PTaGbXIzbIm4YdU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oAIKzIQxrMnjhHP+ykyI+MvtF42WJdAWUektzQnlIvXl2XkvuAHOJgVv4v6u+fcybb5/8Ei/fMKQnwLBgM4gq05hxfnNfz/M5g2hWP8THYA3s67X6piRApAx1M/p5lSWb4qNLpBjMaw7XOzMPY3JCZ0CEJSSOQVkvB9WiHeIw08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qcZdVtqe; 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="qcZdVtqe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 611EFC433F1; Sun, 28 Jan 2024 06:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706422624; bh=A/0GwukbZBKghfdjBoa3UB1juDL1PTaGbXIzbIm4YdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qcZdVtqe5rCoQd0XEKgOrKdcf05mlla/+oeAiURTeOd/jCBUSuSaTndtEmq/zYIay WV48jmPKRBaW0TVfs/qX8z1EXox9GUiUkkpa+RzJgFmwniArGlF/G9S+XoRyqfojU8 6IX9zbMhTtR9OxE19sEqN+bJIiFbC87DsLYkfRvVqAYN/y+/hykgnxlcs+/SjP8VRD AJERy9XT3Mg07nEI3TsL7+jOMRjinFj4pWVbxlR2BUZIgXWJQro9zJy/jXWtUMV2a2 0naFTub9u1YmiXYhAvs6EYqYwMY0TqNtG7o5sD32Eh1uNDViQiVjVwxSpxrB4n6CFz s6itnc57UBRdw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH virtme-docker 3/3] bpf: add bpftests support Date: Sun, 28 Jan 2024 14:16:03 +0800 Message-Id: <9dcddc425bd3aae5730f9c8d2c9bd39ef480e310.1706422466.git.geliang@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch builds bpf tests after building other mptcp selftests in bft mode. And add run_bpftest_all to run bpftests. Disable IA32_EMULATION config to fix this error: ./include/linux/if.h:28:10: fatal error: sys/socket.h: no such file or dire= ctory Signed-off-by: Geliang Tang --- Dockerfile | 1 + entrypoint.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/Dockerfile b/Dockerfile index cbc11f7..77d7423 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ RUN apt-get update && \ wget xz-utils lftp cpio u-boot-tools \ cscope \ bpftrace \ + python3-docutils \ && \ apt-get clean =20 diff --git a/entrypoint.sh b/entrypoint.sh index caddd5f..c334cf6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -87,6 +87,8 @@ VIRTME_RUN_EXPECT=3D"${VIRTME_SCRIPTS_DIR}/virtme.expect" =20 SELFTESTS_DIR=3D"${INPUT_SELFTESTS_DIR:-tools/testing/selftests/net/mptcp}" SELFTESTS_CONFIG=3D"${SELFTESTS_DIR}/config" +BPFTESTS_DIR=3D"${INPUT_BPFTESTS_DIR:-tools/testing/selftests/bpf}" +BPFTESTS_CONFIG=3D"${BPFTESTS_DIR}/config" =20 export CCACHE_MAXSIZE=3D"${INPUT_CCACHE_MAXSIZE}" export CCACHE_DIR=3D"${VIRTME_WORKDIR}/ccache" @@ -349,6 +351,13 @@ gen_kconfig() { local mode kconfig=3D() # Extra options are needed for kselftests ./scripts/kconfig/merge_config.sh -m "${VIRTME_KCONFIG}" "${SELFTESTS_CON= FIG}" =20 + if [ "${mode}" =3D "btf" ]; then + # Extra options are needed for bpftests + ./scripts/kconfig/merge_config.sh -m "${VIRTME_KCONFIG}" "${BPFTESTS_CON= FIG}" + kconfig+=3D(-e DEBUG_INFO_BTF_MODULES -e MODULE_ALLOW_BTF_MISMATCH) + kconfig+=3D(-d IA32_EMULATION) + fi + ./scripts/config --file "${VIRTME_KCONFIG}" "${kconfig[@]}" =20 _make_o olddefconfig @@ -416,6 +425,21 @@ build_selftests() { _make_o KHDR_INCLUDES=3D"-I${VIRTME_BUILD_DIR}/include" -C "${SELFTESTS_D= IR}" } =20 +build_bpftests() { + if [ "${INPUT_BUILD_SKIP_BPFTESTS}" =3D 1 ]; then + printinfo "Skip bpftests build" + return 0 + fi + + rm -rf ${BPFTESTS_DIR}/{test_progs,bpf_testmod.ko,test_progs-no_alu32,no_= alu32} + + _make_o KHDR_INCLUDES=3D"-I${VIRTME_BUILD_DIR}/include" -C "${BPFTESTS_DI= R}" + + ln -s ${VIRTME_BUILD_DIR}/{test_progs,bpf_testmod.ko,test_progs-no_alu32,= no_alu32} ${BPFTESTS_DIR}/ + printf "#!/bin/sh\n\n./test_progs -t mptcp\n./test_progs-no_alu32 -t mptc= p" > ${BPFTESTS_DIR}/bpf_selftest.sh + chmod +x ${BPFTESTS_DIR}/bpf_selftest.sh +} + build_packetdrill() { local old_pwd kversion kver_maj kver_min branch if [ "${INPUT_BUILD_SKIP_PACKETDRILL}" =3D 1 ]; then printinfo "Skip Packetdrill build" @@ -503,6 +527,9 @@ prepare() { local mode no_tap=3D1 printinfo "Prepare the environment" =20 build_selftests + if [ "${mode}" =3D "btf" ]; then + build_bpftests + fi build_packetdrill prepare_hosts_file =20 @@ -760,11 +787,39 @@ run_packetdrill_all() { local pktd_dir rc=3D0 return \${rc} } =20 +# \$1: output tap file; rest: command to launch +_run_bpftest_one_tap() { + cd "${KERNEL_SRC}/${BPFTESTS_DIR}" + _tap "\${@}" +} + +# \$1: script file; rest: command to launch +run_bpftest_one() { local sf tap + sf=3D\$(basename \${1}) + tap=3Dbpftest_\${sf:0:-3} + shift + + _can_run "\${tap}" || return 0 + + _run_bpftest_one_tap "${RESULTS_DIR}/\${tap}" "./\${sf}" "\${@}" +} + +run_bpftest_all() { local sf rc=3D0 + sf=3D${KERNEL_SRC}/${BPFTESTS_DIR}/bpf_selftest.sh + if [ -e "\${sf}" ]; then + run_bpftest_one "\${sf}" || rc=3D\${?} + rm -rf "\${sf}" + fi + + return \${rc} +} + run_all() { run_kunit_all run_selftest_all run_mptcp_connect_mmap run_packetdrill_all + run_bpftest_all } =20 has_call_trace() { --=20 2.40.1