bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v4 bpf-next 0/2] bpf: Add a new API
@ 2019-06-07 23:25 Roman Gushchin
  2019-06-07 23:47 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Gushchin @ 2019-06-07 23:25 UTC (permalink / raw)
  To: Daniel Borkmann, Hechao Li; +Cc: Hechao Li, bpf, netdev, ast, Kernel Team

On 06/07/2019 06:37 PM, Hechao Li wrote:
> 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.
> 
> v4: Fixed error code when reading 0 bytes from 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/libbpf.h                 | 16 ++++++++
>  tools/lib/bpf/libbpf.map               |  1 +
>  tools/testing/selftests/bpf/bpf_util.h | 37 +++--------------
>  5 files changed, 84 insertions(+), 80 deletions(-)

> Series applied, thanks!

> P.s.: Please retain full history (v1->v2->v3->v4) in cover letter next time as
> that is typical convention and helps readers of git log to follow what has been
> changed over time.


Hello!

I'm getting the following errors on an attempt to build bpf tests.
Reverting the last patch fixes it.

Please, take a look.

Thank you!


clang -I. -I./include/uapi -I../../../include/uapi -idirafter /usr/local/include -idirafter /opt/fb/devtoolset/bin/../lib/clang/4.0.0/include -idirafter /usr/include -Wno-compare-distinct-pointer-types \
	 -O2 -target bpf -emit-llvm -c progs/sockmap_parse_prog.c -o - |      \
llc -march=bpf -mcpu=generic  -filetype=obj -o /data/users/guro/linux/tools/testing/selftests/bpf/sockmap_parse_prog.o
In file included from progs/sockmap_parse_prog.c:3:
./bpf_util.h:9:10: fatal error: 'libbpf.h' file not found
#include <libbpf.h>
         ^~~~~~~~~~
1 error generated.

...

clang -I. -I./include/uapi -I../../../include/uapi -idirafter /usr/local/include -idirafter /opt/fb/devtoolset/bin/../lib/clang/4.0.0/include -idirafter /usr/include -Wno-compare-distinct-pointer-types \
	 -O2 -target bpf -emit-llvm -c progs/test_sysctl_prog.c -o - |      \
llc -march=bpf -mcpu=generic  -filetype=obj -o /data/users/guro/linux/tools/testing/selftests/bpf/test_sysctl_prog.o
In file included from progs/test_sysctl_prog.c:11:
./bpf_util.h:9:10: fatal error: 'libbpf.h' file not found
#include <libbpf.h>
         ^~~~~~~~~~
1 error generated.
clang -I. -I./include/uapi -I../../../include/uapi -idirafter /usr/local/include -idirafter /opt/fb/devtoolset/bin/../lib/clang/4.0.0/include -idirafter /usr/include -Wno-compare-distinct-pointer-types \
	 -O2 -target bpf -emit-llvm -c progs/sockmap_verdict_prog.c -o - |      \
llc -march=bpf -mcpu=generic  -filetype=obj -o /data/users/guro/linux/tools/testing/selftests/bpf/sockmap_verdict_prog.o
In file included from progs/sockmap_verdict_prog.c:3:
./bpf_util.h:9:10: fatal error: 'libbpf.h' file not found
#include <libbpf.h>
         ^~~~~~~~~~
1 error generated.

...

clang -I. -I./include/uapi -I../../../include/uapi -idirafter /usr/local/include -idirafter /opt/fb/devtoolset/bin/../lib/clang/4.0.0/include -idirafter /usr/include -Wno-compare-distinct-pointer-types \
	 -O2 -target bpf -emit-llvm -c progs/sockmap_tcp_msg_prog.c -o - |      \
llc -march=bpf -mcpu=generic  -filetype=obj -o /data/users/guro/linux/tools/testing/selftests/bpf/sockmap_tcp_msg_prog.o
In file included from progs/sockmap_tcp_msg_prog.c:3:
./bpf_util.h:9:10: fatal error: 'libbpf.h' file not found
#include <libbpf.h>
         ^~~~~~~~~~
1 error generated.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v4 bpf-next 0/2] bpf: Add a new API
  2019-06-07 23:25 [PATCH v4 bpf-next 0/2] bpf: Add a new API Roman Gushchin
@ 2019-06-07 23:47 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2019-06-07 23:47 UTC (permalink / raw)
  To: Roman Gushchin, Hechao Li; +Cc: bpf, netdev, ast, Kernel Team

On 06/08/2019 01:25 AM, Roman Gushchin wrote:
> On 06/07/2019 06:37 PM, Hechao Li wrote:
>> 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.
>>
>> v4: Fixed error code when reading 0 bytes from 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/libbpf.h                 | 16 ++++++++
>>  tools/lib/bpf/libbpf.map               |  1 +
>>  tools/testing/selftests/bpf/bpf_util.h | 37 +++--------------
>>  5 files changed, 84 insertions(+), 80 deletions(-)
> 
>> Series applied, thanks!
> 
>> P.s.: Please retain full history (v1->v2->v3->v4) in cover letter next time as
>> that is typical convention and helps readers of git log to follow what has been
>> changed over time.
> 
> 
> Hello!
> 
> I'm getting the following errors on an attempt to build bpf tests.
> Reverting the last patch fixes it.
> 
[...]
> 
> clang -I. -I./include/uapi -I../../../include/uapi -idirafter /usr/local/include -idirafter /opt/fb/devtoolset/bin/../lib/clang/4.0.0/include -idirafter /usr/include -Wno-compare-distinct-pointer-types \
> 	 -O2 -target bpf -emit-llvm -c progs/sockmap_parse_prog.c -o - |      \
> llc -march=bpf -mcpu=generic  -filetype=obj -o /data/users/guro/linux/tools/testing/selftests/bpf/sockmap_parse_prog.o
> In file included from progs/sockmap_parse_prog.c:3:
> ./bpf_util.h:9:10: fatal error: 'libbpf.h' file not found
> #include <libbpf.h>
>          ^~~~~~~~~~
> 1 error generated.

True, I've therefore tossed the series from bpf-next. Hechao, please fix and resubmit.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-07 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 23:25 [PATCH v4 bpf-next 0/2] bpf: Add a new API Roman Gushchin
2019-06-07 23:47 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).