public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Jiri Olsa <jolsa@redhat.com>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>, Jakub Kicinski <kuba@kernel.org>,
	Jiri Pirko <jiri@mellanox.com>
Subject: Re: [RFC] failing selftests/bpf/test_offload.py
Date: Mon, 31 Jan 2022 14:15:07 +0100	[thread overview]
Message-ID: <87k0egt5b8.fsf@toke.dk> (raw)
In-Reply-To: <20220130225101.47514-1-jolsa@kernel.org>

Jiri Olsa <jolsa@redhat.com> writes:

> hi,
> I have failing test_offload.py with following output:
>
>   # ./test_offload.py
>   ...
>   Test bpftool bound info reporting (own ns)...
>   FAIL: 3 BPF maps loaded, expected 2
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 1177, in <module>
>       check_dev_info(False, "")
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 645, in check_dev_info
>       maps = bpftool_map_list(expected=2, ns=ns)
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 190, in bpftool_map_list
>       fail(True, "%d BPF maps loaded, expected %d" %
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 86, in fail
>       tb = "".join(traceback.extract_stack().format())
>
> it fails to detect maps from bpftool's feature detection,
> that did not make it yet through deferred removal
>
> with the fix below I have this subtest passed, but it fails
> further on:
>
>   # ./test_offload.py
>   ...
>   Test bpftool bound info reporting (own ns)...
>   Test bpftool bound info reporting (other ns)...
>   Test bpftool bound info reporting (remote ns)...
>   Test bpftool bound info reporting (back to own ns)...
>   Test bpftool bound info reporting (removed dev)...
>   Test map update (no flags)...
>   Test map update (exists)...
>   Test map update (noexist)...
>   Test map dump...
>   Test map dump...
>   Traceback (most recent call last):
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 1251, in <module>
>       _, entries = bpftool("map dump id %d" % (m["id"]))
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 169, in bpftool
>       return tool("bpftool", args, {"json":"-p"}, JSON=JSON, ns=ns,
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 155, in tool
>       ret, stdout = cmd(ns + name + " " + params + args,
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 109, in cmd
>       return cmd_result(proc, include_stderr=include_stderr, fail=fail)
>     File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 131, in cmd_result
>       raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
>   Exception: Command failed: bpftool -p map dump id 4325
>
> the test seems to expect maps having BTF loaded, which for some reason
> did not happen, so the test fails with bpftool pretty dump fail
>
> the test loads the object with 'ip link ...', which I never touched,
> so I wanted ask first before I dive in, perhaps I miss some setup
>
> thoughts? ;-)

It looks like the test_offload.py has been using 'bpftool -p' since its
inception (in commit: 417ec26477a5 ("selftests/bpf: add offload test
based on netdevsim") introduced in December 2017), so this sounds like a
regression in bpftool?

-Toke


  reply	other threads:[~2022-01-31 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 22:51 [RFC] failing selftests/bpf/test_offload.py Jiri Olsa
2022-01-31 13:15 ` Toke Høiland-Jørgensen [this message]
2022-02-04 15:20   ` Jiri Olsa

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=87k0egt5b8.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jiri@mellanox.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox