All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	KP Singh <kpsingh@kernel.org>
Cc: Lorenz Bauer <lmb@cloudflare.com>, Shuah Khan <shuah@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	kernel-team <kernel-team@cloudflare.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf] selftests: bpf: check map in map pruning
Date: Thu, 18 Nov 2021 12:56:36 +0100	[thread overview]
Message-ID: <06aa2d62d09bcd0a39898f7dcc7fb2fcdc262081.camel@linux.ibm.com> (raw)
In-Reply-To: <CAEf4BzZTiyyKLg2y_dSvEEgzjSsCRCeRgt99DmFAHJyGqht8tw@mail.gmail.com>

On Wed, 2021-11-17 at 17:38 -0800, Andrii Nakryiko wrote:
> On Wed, Nov 17, 2021 at 5:29 PM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
> > 
> > On Wed, Nov 17, 2021 at 5:01 PM Alexei Starovoitov
> > <alexei.starovoitov@gmail.com> wrote:
> > > 
> > > On Wed, Nov 17, 2021 at 08:47:45AM +0000, Lorenz Bauer wrote:
> > > > On Sat, 13 Nov 2021 at 01:27, Alexei Starovoitov
> > > > <alexei.starovoitov@gmail.com> wrote:
> > > > > 
> > > > > Not sure how you've tested it, but it doesn't work in unpriv:
> > > > > $ test_verifier 789
> > > > > #789/u map in map state pruning FAIL
> > > > > processed 26 insns (limit 1000000) max_states_per_insn 0
> > > > > total_states
> > > > > 2 peak_states 2 mark_read 1
> > > > > #789/p map in map state pruning OK
> > > > 
> > > > Strange, I have a script that I use for bisecting which uses a
> > > > minimal
> > > > .config + virtue to run a vm, plus I was debugging in gdb at the
> > > > same
> > > > time. I might have missed this, apologies.
> > > > 
> > > > I guess vmtest.sh is the canonical way to run tests now?
> > > 
> > > vmtest.sh runs test_progs only. That's the minimum bar that
> > 
> > It runs test_progs by default, unless something else is requested.
> > You
> > can run anything inside it, e.g.:
> > 
> > ./vmtest.sh -- ./test_maps
> > 
> > BTW, we recently moved configs around in libbpf repo on Github, so
> > this script broke. I'm sending a fix in a few minutes, hopefully.
> 
> ... and of course it's not that simple. [0] recently changed how we
> build qemu image and vmtest.sh had some assumptions. Some trivial
> things I fixed, but I'm not too familiar with the init scripts stuff.
> Adding Ilya and KP to hopefully help with this. Ilya, KP, can you
> please help restore vmtest.sh functionality?
> 
> After fixing few paths:
> 
> diff --git a/tools/testing/selftests/bpf/vmtest.sh
> b/tools/testing/selftests/bpf/vmtest.sh
> index 027198768fad..7ea40108b85d 100755
> --- a/tools/testing/selftests/bpf/vmtest.sh
> +++ b/tools/testing/selftests/bpf/vmtest.sh
> @@ -13,8 +13,8 @@ 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/latest.config
> "
> -
> KCONFIG_API_URL="https://api.github.com/repos/libbpf/libbpf/contents/travis-ci/vmtest/configs/latest.config
> "
> +KCONFIG_URL="https://raw.githubusercontent.com/libbpf/libbpf/master/travis-ci/vmtest/configs/config-latest.x86_64
> "
> +KCONFIG_API_URL="https://api.github.com/repos/libbpf/libbpf/contents/travis-ci/vmtest/configs/config-latest.x86_64
> "
>  INDEX_URL="https://raw.githubusercontent.com/libbpf/libbpf/master/travis-ci/vmtest/configs/INDEX
> "
>  NUM_COMPILE_JOBS="$(nproc)"
>  LOG_FILE_BASE="$(date +"bpf_selftests.%Y-%m-%d_%H-%M-%S")"
> @@ -85,7 +85,7 @@ newest_rootfs_version()
>  {
>         {
>         for file in "${!URLS[@]}"; do
> -               if [[ $file =~ ^libbpf-vmtest-rootfs-(.*)\.tar\.zst$
> ]]; then
> +               if [[ $file =~
> ^x86_64/libbpf-vmtest-rootfs-(.*)\.tar\.zst$ ]]; then
>                         echo "${BASH_REMATCH[1]}"
>                 fi
>         done
> 
> ... the next problem is more severe. Script complains about missing
> /etc/rcS.d, if I just force-created it, when kernel boots we get:
> 
> 
> [    1.050803] ---[ end Kernel panic - not syncing: No working init
> found.  Try passing init= option to kernel. See Linux
> Documentation/admin-guide/init.rst for guidance. ]---
> 
> 
> Please help.
> 
>   [0] https://github.com/libbpf/libbpf/pull/204

I've posted a fix, please give it a try:

https://lore.kernel.org/bpf/20211118115225.1349726-1-iii@linux.ibm.com/

Missing was the ${ARCH} prefix when downloading the image, so it ended
up being empty. Now your ~/.bpf_selftests is poisoned with it, so
you'll need to run vmtest.sh with -i switch once in order to remove the
bad image.

Best regards,
Ilya


  parent reply	other threads:[~2021-11-18 11:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 16:14 [PATCH bpf] selftests: bpf: check map in map pruning Lorenz Bauer
2021-11-12 15:20 ` patchwork-bot+netdevbpf
2021-11-13  1:27 ` Alexei Starovoitov
2021-11-17  8:47   ` Lorenz Bauer
2021-11-18  1:00     ` Alexei Starovoitov
2021-11-18  1:29       ` Andrii Nakryiko
2021-11-18  1:38         ` Andrii Nakryiko
2021-11-18 11:05           ` Ilya Leoshkevich
2021-11-18 11:56           ` Ilya Leoshkevich [this message]
2021-11-18 15:20             ` KP Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06aa2d62d09bcd0a39898f7dcc7fb2fcdc262081.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@cloudflare.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lmb@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.