From: kernel test robot <lkp@intel.com>
To: Alexei Starovoitov <ast@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [ast-bpf:arena 18/20] tools/testing/selftests/bpf/prog_tests/arena_list.c:49:23: error: 'struct arena_list' has no member named 'arena'
Date: Mon, 19 Feb 2024 13:02:31 +0800 [thread overview]
Message-ID: <202402191246.bYaTaQdS-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git arena
head: 4e726b87a660bf893d79aaea4e22f1bc9fc03774
commit: aa31e8a044a62529f5afa3275d63b5019142c901 [18/20] selftests/bpf: Add bpf_arena_list test.
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240219/202402191246.bYaTaQdS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402191246.bYaTaQdS-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from tools/testing/selftests/bpf/prog_tests/arena_list.c:3:
tools/testing/selftests/bpf/prog_tests/arena_list.c: In function 'test_arena_list_add_del':
>> tools/testing/selftests/bpf/prog_tests/arena_list.c:49:23: error: 'struct arena_list' has no member named 'arena'
49 | ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:16: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
>> tools/testing/selftests/bpf/prog_tests/arena_list.c:49:23: error: 'struct arena_list' has no member named 'arena'
49 | ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:34: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
tools/testing/selftests/bpf/prog_tests/arena_list.c:50:23: error: 'struct arena_list' has no member named 'arena'
50 | ASSERT_EQ(skel->arena->test_val, cnt + 1, "num of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:16: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
tools/testing/selftests/bpf/prog_tests/arena_list.c:50:23: error: 'struct arena_list' has no member named 'arena'
50 | ASSERT_EQ(skel->arena->test_val, cnt + 1, "num of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:34: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
tools/testing/selftests/bpf/prog_tests/arena_list.c:57:23: error: 'struct arena_list' has no member named 'arena'
57 | ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:16: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
tools/testing/selftests/bpf/prog_tests/arena_list.c:57:23: error: 'struct arena_list' has no member named 'arena'
57 | ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
| ^~
tools/testing/selftests/bpf/test_progs.h:239:34: note: in definition of macro 'ASSERT_EQ'
239 | typeof(actual) ___act = (actual); \
| ^~~~~~
vim +49 tools/testing/selftests/bpf/prog_tests/arena_list.c
> 3 #include <test_progs.h>
4 #include <sys/mman.h>
5 #include <network_helpers.h>
6
7 #define PAGE_SIZE 4096
8
9 #include "bpf_arena_list.h"
10 #include "arena_list.skel.h"
11
12 struct elem {
13 struct arena_list_node node;
14 __u64 value;
15 };
16
17 static int list_sum(struct arena_list_head *head)
18 {
19 struct elem __arena *n;
20 int sum = 0;
21
22 list_for_each_entry(n, head, node)
23 sum += n->value;
24 return sum;
25 }
26
27 static void test_arena_list_add_del(int cnt)
28 {
29 LIBBPF_OPTS(bpf_test_run_opts, opts);
30 struct arena_list *skel;
31 int expected_sum = (u64)cnt * (cnt - 1) / 2;
32 int ret, sum;
33
34 skel = arena_list__open_and_load();
35 if (!ASSERT_OK_PTR(skel, "arena_list__open_and_load"))
36 return;
37
38 skel->bss->cnt = cnt;
39 ret = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.arena_list_add), &opts);
40 ASSERT_OK(ret, "ret_add");
41 ASSERT_OK(opts.retval, "retval");
42 if (skel->bss->skip) {
43 printf("%s:SKIP:compiler doesn't support arena_cast\n", __func__);
44 test__skip();
45 goto out;
46 }
47 sum = list_sum(skel->bss->list_head);
48 ASSERT_EQ(sum, expected_sum, "sum of elems");
> 49 ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
50 ASSERT_EQ(skel->arena->test_val, cnt + 1, "num of elems");
51
52 ret = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.arena_list_del), &opts);
53 ASSERT_OK(ret, "ret_del");
54 sum = list_sum(skel->bss->list_head);
55 ASSERT_EQ(sum, 0, "sum of list elems after del");
56 ASSERT_EQ(skel->bss->list_sum, expected_sum, "sum of list elems computed by prog");
57 ASSERT_EQ(skel->arena->arena_sum, expected_sum, "__arena sum of elems");
58 out:
59 arena_list__destroy(skel);
60 }
61
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-02-19 5:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202402191246.bYaTaQdS-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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.