]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add test for bpf array map iterators
authorYonghong Song <yhs@fb.com>
Thu, 23 Jul 2020 18:41:21 +0000 (11:41 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:16:34 +0000 (20:16 -0700)
commit962865714ecdbbffa1b8959d6532bf86b44fe543
tree5c4d32ab95660adde58cfe0aea34e857f1336cf3
parent86e63ded6c23908a30434512ff14d6c52760fa08
selftests/bpf: Add test for bpf array map iterators

Two subtests are added.
  $ ./test_progs -n 4
  ...
  #4/20 bpf_array_map:OK
  #4/21 bpf_percpu_array_map:OK
  ...

The bpf_array_map subtest also tested bpf program
changing array element values and send key/value
to user space through bpf_seq_write() interface.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200723184121.591367-1-yhs@fb.com
tools/testing/selftests/bpf/prog_tests/bpf_iter.c
tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c [new file with mode: 0644]