test BPF programs.
This can also make it clear that bpf_util.h is a user-space utility
while bpf_helpers.h is a kernel space utility.
Signed-off-by: Hechao Li
---
tools/testing/selftests/bpf/bpf_endian.h | 1 +
tools/testing/selftests/bpf/progs/sockmap_parse_prog.c | 1
Use the newly added bpf_num_possible_cpus() in bpftool and selftests
and remove duplicate implementations.
Signed-off-by: Hechao Li
---
tools/bpf/bpftool/common.c | 53 +++---
tools/testing/selftests/bpf/bpf_util.h | 37 +++---
2 files changed, 10
One commit to remove bpf_util.h from test BPF C programs.
One commit to reuse libbpf_num_possible_cpus() in bpftools
and bpf_util.h.
Hechao Li (3):
bpf: add a new API libbpf_num_possible_cpus()
selftests/bpf: remove bpf_util.h from BPF C progs
bpf: use libbpf_num_possible_cpus interna
Adding a new API libbpf_num_possible_cpus() that helps user with
per-CPU map operations.
Signed-off-by: Hechao Li
---
tools/lib/bpf/libbpf.c | 57
tools/lib/bpf/libbpf.h | 16 +++
tools/lib/bpf/libbpf.map | 1 +
3 files changed, 74
leaving feature-reallocarray being 1, which causes reallocarray
not defined when re-compliing with GCC 7.x. This diff adds feature
folder to EXTRA_CLEAN to avoid this problem.
v2: Rephrase the commit message.
Signed-off-by: Hechao Li
Acked-by: Andrii Nakryiko
---
tools/testing/selftests/bpf
Andrii Nakryiko wrote on Mon [2019-Jun-10 11:05:28
-0700]:
> On Mon, Jun 10, 2019 at 9:57 AM Hechao Li wrote:
> >
> > I got an error when compiling selftests/bpf:
> >
> > libbpf.c:411:10: error: implicit declaration of function 'reallocarray';
> >
ocarray=1 in FEATURE-DUMP.libbpf and it
was fixed by manually removing feature/ folder. This diff adds feature/
to EXTRA_CLEAN to avoid this problem.
Signed-off-by: Hechao Li
---
tools/testing/selftests/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/t
Adding a new API libbpf_num_possible_cpus() that helps user with
per-CPU map operations.
Signed-off-by: Hechao Li
---
tools/lib/bpf/libbpf.c | 57
tools/lib/bpf/libbpf.h | 16 +++
tools/lib/bpf/libbpf.map | 1 +
3 files changed, 74
Use the newly added bpf_num_possible_cpus() in bpftool and selftests
and remove duplicate implementations.
This patch also removed bpf_util.h from some test BPF programs
since it is a userspace utility.
Signed-off-by: Hechao Li
---
tools/bpf/bpftool/common.c| 53
changed.
v3: Make sure libbpf_num_possible_cpus never returns 0 so that user only has
to check if ret value < 0.
v4: Fix error code when reading 0 bytes from possible CPU file.
v5: Fix selftests compliation issue.
Hechao Li (2):
bpf: add a new API libbpf_num_possible_cpus()
bpf:
possible CPU file
Hechao Li (2):
bpf: add a new API libbpf_num_possible_cpus()
bpf: use libbpf_num_possible_cpus in bpftool and selftests
tools/bpf/bpftool/common.c | 53 +++-
tools/lib/bpf/libbpf.c | 57 ++
tools/lib/bpf
Adding a new API libbpf_num_possible_cpus() that helps user with
per-CPU map operations.
Signed-off-by: Hechao Li
Acked-by: Song Liu
---
tools/lib/bpf/libbpf.c | 57
tools/lib/bpf/libbpf.h | 16 +++
tools/lib/bpf/libbpf.map | 1 +
3 files
Use the newly added bpf_num_possible_cpus() in bpftool and selftests
and remove duplicate implementations.
Signed-off-by: Hechao Li
Acked-by: Song Liu
---
tools/bpf/bpftool/common.c | 53 +++---
tools/testing/selftests/bpf/bpf_util.h | 37 +++---
2
Use the newly added bpf_num_possible_cpus() in bpftool and selftests
and remove duplicate implementations.
Signed-off-by: Hechao Li
---
tools/bpf/bpftool/common.c | 53 +++---
tools/testing/selftests/bpf/bpf_util.h | 37 +++---
2 files changed, 10
Adding a new API libbpf_num_possible_cpus() that helps user with
per-CPU map operations.
Signed-off-by: Hechao Li
---
tools/lib/bpf/libbpf.c | 57
tools/lib/bpf/libbpf.h | 16 +++
tools/lib/bpf/libbpf.map | 1 +
3 files changed, 74
Getting number of possible CPUs is commonly used for per-CPU BPF maps
and perf_event_maps. Add a new API libbpf_num_possible_cpus() that
helps user with per-CPU related operations and remove duplicate
implementations in bpftool and selftests.
Hechao Li (2):
bpf: add a new API
16 matches
Mail list logo