[PATCH bpf 1/6] tools: bpftool: fix arguments for p_err() in do_event_pipe()

2019-08-15 Thread Quentin Monnet
fde ("tools: bpftool: add simple perf event output reader") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/map_perf_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/map_perf_ring.c b/tools/bpf/bpftool

[PATCH bpf 4/6] tools: bpftool: fix format string for p_err() in query_flow_dissector()

2019-08-15 Thread Quentin Monnet
ec80f ("bpftool: show flow_dissector attachment status") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c index 67e99c56bc88..e3b7

[PATCH bpf 5/6] tools: bpftool: fix format string for p_err() in detect_common_prefix()

2019-08-15 Thread Quentin Monnet
t's fix it by using a "%s" format string. Fixes: ba95c7452439 ("tools: bpftool: add "prog run" subcommand to test-run programs") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/main.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH bpf 2/6] tools: bpftool: fix format strings and arguments for jsonw_printf()

2019-08-15 Thread Quentin Monnet
pe cast. Fixes: b12d6ec09730 ("bpf: btf: add btf print functionality") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/btf_dumper.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/b

[PATCH bpf-next 2/5] tools: bpf: synchronise BPF UAPI header with tools

2019-08-15 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the addition of the new BPF_BTF_GET_NEXT_ID syscall command for bpf(). Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi

[PATCH bpf-next 3/5] libbpf: refactor bpf_*_get_next_id() functions

2019-08-15 Thread Quentin Monnet
In preparation for the introduction of a similar function for retrieving the id of the next BTF object, consolidate the code from bpf_prog_get_next_id() and bpf_map_get_next_id() in libbpf. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/bpf.c | 21

[PATCH bpf-next 1/5] bpf: add new BPF_BTF_GET_NEXT_ID syscall command

2019-08-15 Thread Quentin Monnet
Add a new command for the bpf() system call: BPF_BTF_GET_NEXT_ID is used to cycle through all BTF objects loaded on the system. The motivation is to be able to inspect (list) all BTF objects presents on the system. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- include/linux

[PATCH bpf-next 0/5] bpf: list BTF objects loaded on system

2019-08-15 Thread Quentin Monnet
may want to list them too. As a side note, it also turned useful for examining the BTF objects attached to offloaded programs, which would not show in program information because the BTF id is not copied when retrieving such info. A fix is in progress on that side. Quentin Monnet (5): bpf: add

[PATCH bpf-next 4/5] libbpf: add bpf_btf_get_next_id() to cycle through BTF objects

2019-08-15 Thread Quentin Monnet
Add an API function taking a BTF object id and providing the id of the next BTF object in the kernel. This can be used to list all BTF objects loaded on the system. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/Makefile | 2 +- tools/lib/bpf/bpf.c | 5

[PATCH bpf-next 5/5] tools: bpftool: implement "bpftool btf show|list"

2019-08-15 Thread Quentin Monnet
oks more consistent. Example output (plain): # bpftool btf show 9: size 2989B prog_ids 21 map_ids 15 17: size 2847B prog_ids 36 map_ids 30,29,28 26: size 2847B Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- .../bpf/bpftool/Documentation/bpft

Re: [PATCH bpf 0/6] tools: bpftool: fix printf()-like functions

2019-08-16 Thread Quentin Monnet
2019-08-15 22:08 UTC-0700 ~ Alexei Starovoitov > On Thu, Aug 15, 2019 at 7:32 AM Quentin Monnet > wrote: >> >> Hi, >> Because the "__printf()" attributes were used only where the functions are >> implemented, and not in header files, the checks have

Re: [PATCH bpf 0/6] tools: bpftool: fix printf()-like functions

2019-08-16 Thread Quentin Monnet
2019-08-16 10:11 UTC-0700 ~ Alexei Starovoitov > On Fri, Aug 16, 2019 at 9:41 AM Quentin Monnet > wrote: >> >> 2019-08-15 22:08 UTC-0700 ~ Alexei Starovoitov >> >>> On Thu, Aug 15, 2019 at 7:32 AM Quentin Monnet >>> wrote: >>>> >>&g

[PATCH bpf-next v2 5/5] tools: bpftool: implement "bpftool btf show|list"

2019-08-20 Thread Quentin Monnet
oks more consistent. Example output (plain): # bpftool btf show 9: size 2989B prog_ids 21 map_ids 15 17: size 2847B prog_ids 36 map_ids 30,29,28 26: size 2847B Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- .../bpf/bpftool/Documentation/bpft

[PATCH bpf-next v2 1/5] bpf: add new BPF_BTF_GET_NEXT_ID syscall command

2019-08-20 Thread Quentin Monnet
Add a new command for the bpf() system call: BPF_BTF_GET_NEXT_ID is used to cycle through all BTF objects loaded on the system. The motivation is to be able to inspect (list) all BTF objects presents on the system. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- include/linux

[PATCH bpf-next v2 0/5] bpf: list BTF objects loaded on system

2019-08-20 Thread Quentin Monnet
libbpf function on top of Andrii's changes regarding libbpf versioning. Quentin Monnet (5): bpf: add new BPF_BTF_GET_NEXT_ID syscall command tools: bpf: synchronise BPF UAPI header with tools libbpf: refactor bpf_*_get_next_id() functions libbpf: add bpf_btf_get_next_id() to cycle throug

[PATCH bpf-next v2 4/5] libbpf: add bpf_btf_get_next_id() to cycle through BTF objects

2019-08-20 Thread Quentin Monnet
Add an API function taking a BTF object id and providing the id of the next BTF object in the kernel. This can be used to list all BTF objects loaded on the system. v2: - Rebase on top of Andrii's changes regarding libbpf versioning. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kic

[PATCH bpf-next v2 2/5] tools: bpf: synchronise BPF UAPI header with tools

2019-08-20 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the addition of the new BPF_BTF_GET_NEXT_ID syscall command for bpf(). Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi

[PATCH bpf-next v2 3/5] libbpf: refactor bpf_*_get_next_id() functions

2019-08-20 Thread Quentin Monnet
In preparation for the introduction of a similar function for retrieving the id of the next BTF object, consolidate the code from bpf_prog_get_next_id() and bpf_map_get_next_id() in libbpf. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/bpf.c | 21

[PATCH bpf-next] bpf: add BTF ids in procfs for file descriptors to BTF objects

2019-08-20 Thread Quentin Monnet
Implement the show_fdinfo hook for BTF FDs file operations, and make it print the id and the size of the BTF object. This allows for a quick retrieval of the BTF id from its FD; or it can help understanding what type of object (BTF) the file descriptor points to. Signed-off-by: Quentin Monnet

Re: [oss-drivers] Re: [PATCH bpf-next] bpf: add BTF ids in procfs for file descriptors to BTF objects

2019-08-20 Thread Quentin Monnet
2019-08-20 15:36 UTC+0200 ~ Daniel Borkmann > On 8/20/19 11:52 AM, Quentin Monnet wrote: >> Implement the show_fdinfo hook for BTF FDs file operations, and make it >> print the id and the size of the BTF object. This allows for a quick >> retrieval of the BTF id from i

[PATCH bpf-next v2] bpf: add BTF ids in procfs for file descriptors to BTF objects

2019-08-20 Thread Quentin Monnet
FD info. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- kernel/bpf/btf.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 5fcc7a17eb5a..6b403dc18486 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -3376,6 +3376,15

[PATCH bpf-next 0/2] tools: bpftool: work with frozen maps

2019-08-21 Thread Quentin Monnet
Hi, This is a simple set to add support for BPF map freezing to bpftool. First patch makes bpftool indicate if a map is frozen when listing BPF maps. Second patch adds a command to freeze a map loaded on the system. Quentin Monnet (2): tools: bpftool: show frozen status for maps tools

[PATCH bpf-next 1/2] tools: bpftool: show frozen status for maps

2019-08-21 Thread Quentin Monnet
t. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/map.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index bfbbc6b4cb83..af2e9eb9747b 100644 --- a/tools/b

[PATCH bpf-next 2/2] tools: bpftool: add "bpftool map freeze" subcommand

2019-08-21 Thread Quentin Monnet
Add a new subcommand to freeze maps from user space. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- .../bpf/bpftool/Documentation/bpftool-map.rst | 9 + tools/bpf/bpftool/bash-completion/bpftool | 4 +-- tools/bpf/bpftool/map.c | 34

Re: [PATCH v2 2/4] bpf: fix 'struct pt_reg' typo in documentation

2019-08-21 Thread Quentin Monnet
2019-08-21 00:08 UTC+0100 ~ Peter Wu > There is no 'struct pt_reg'. > > Signed-off-by: Peter Wu Reviewed-by: Quentin Monnet Thanks for the fix! Quentin

Re: [PATCH bpf-next 2/2] tools: bpftool: add "bpftool map freeze" subcommand

2019-08-21 Thread Quentin Monnet
2019-08-21 13:40 UTC+0200 ~ Daniel Borkmann > On 8/21/19 10:52 AM, Quentin Monnet wrote: >> Add a new subcommand to freeze maps from user space. >> >> Signed-off-by: Quentin Monnet >> Reviewed-by: Jakub Kicinski >> --- >>   .../bpf/bpftool/Documentation/bp

[PATCH bpf-next 1/3] tools: bpftool: ignore make built-in rules for getting kernel version

2019-08-29 Thread Quentin Monnet
; does not exist. Finished prerequisites of target file 'archheaders'. Must remake target 'archheaders'. Putting child 0x55976f4f6980 (archheaders) PID 31743 on the chain. To avoid that, pass the -r and -R flags to eliminate the use of make built-

[PATCH bpf-next 2/3] tools: bpftool: improve and check builds for different make invocations

2019-08-29 Thread Quentin Monnet
a new script is added to the BPF selftests. Note that some invocations require the kernel to be configured, so the script skips them if no .config file is found. Reported-by: Lorenz Bauer Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Makefile| 12 +- tools/testing/s

[PATCH bpf-next 0/3] tools: bpftool: improve bpftool build experience

2019-08-29 Thread Quentin Monnet
c: Lorenz Bauer Cc: Ilya Leoshkevich Cc: Jakub Kicinski Quentin Monnet (3): tools: bpftool: ignore make built-in rules for getting kernel version tools: bpftool: improve and check builds for different make invocations tools: bpftool: do not link twice against libbpf.a in Makefile t

[PATCH bpf-next 3/3] tools: bpftool: do not link twice against libbpf.a in Makefile

2019-08-29 Thread Quentin Monnet
evich Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 3fc82ff9b52c..22b5a8f2c53d 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Mak

Re: [PATCH bpf-next 2/3] tools: bpftool: improve and check builds for different make invocations

2019-08-30 Thread Quentin Monnet
2019-08-29 18:03 UTC+0200 ~ Ilya Leoshkevich >> Am 29.08.2019 um 12:56 schrieb Quentin Monnet : >> >> +make_and_clean() { >> +echo -e "\$PWD:$PWD" >> +echo -e "command: make -s $* >/dev/null" >> +make $J -s $* >/dev/n

[PATCH bpf-next v2 2/4] tools: bpftool: improve and check builds for different make invocations

2019-08-30 Thread Quentin Monnet
an" from the correct directory (bpf/ instead of bpftool/, when relevant). Reported-by: Lorenz Bauer Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Makefile| 12 +- tools/testing/selftests/bpf/Makefile | 3 +- .../selftests/

[PATCH bpf-next v2 0/4] tools: bpftool: improve bpftool build experience

2019-08-30 Thread Quentin Monnet
feature/" and "libbpf/" directories. Cc: Lorenz Bauer Cc: Ilya Leoshkevich Cc: Jakub Kicinski Quentin Monnet (4): tools: bpftool: ignore make built-in rules for getting kernel version tools: bpftool: improve and check builds for different make invocations tools: bpf: acc

[PATCH bpf-next v2 1/4] tools: bpftool: ignore make built-in rules for getting kernel version

2019-08-30 Thread Quentin Monnet
; does not exist. Finished prerequisites of target file 'archheaders'. Must remake target 'archheaders'. Putting child 0x55976f4f6980 (archheaders) PID 31743 on the chain. To avoid that, pass the -r and -R flags to eliminate the use of make built-i

[PATCH bpf-next v2 3/4] tools: bpf: account for generated feature/ and libbpf/ directories

2019-08-30 Thread Quentin Monnet
uot;--" to prevent interpreting $(OUTPUT)/$(DESTDIR) as options. v2: - New patch. Signed-off-by: Quentin Monnet --- tools/bpf/.gitignore | 1 + tools/bpf/Makefile | 5 +++-- tools/bpf/bpftool/.gitignore | 2 ++ tools/bpf/bpftool/Makefile | 10 ++ 4 files chang

[PATCH bpf-next v2 4/4] tools: bpftool: do not link twice against libbpf.a in Makefile

2019-08-30 Thread Quentin Monnet
evich Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index b0c5a369f54a..39bc6f0f4f0b 100644 --- a/tools/bpf/bpftool/Make

Re: [PATCH bpf-next v2] bpf: bpftool, fix documentation for attach types

2019-02-19 Thread Quentin Monnet
ban Crequy > > --- > > Changes v1 to v2: > - fix man pages & bash completion (from Quentin's review) Thanks a lot! Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next v1] tools/bpftool: create map of maps

2019-03-05 Thread Quentin Monnet
2019-03-05 17:38 UTC+0100 ~ Alban Crequy > From: Alban Crequy > > Before this patch, there was no way to fill attr.inner_map_fd, necessary > for array_of_maps or hash_of_maps. > > This patch adds keyword 'innermap' to pass the innermap, either as an id > or as a pinned map. > > Example of comm

[PATCH bpf 3/3] tools: bpf: synchronise BPF UAPI header with tools

2019-03-14 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the latest fixes and additions to the documentation for the BPF helpers. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/include/uapi/linux/bpf.h | 183 +++-- 1 file changed, 120

[PATCH bpf 0/3] fixes and additions for BPF helpers doc

2019-03-14 Thread Quentin Monnet
(). The last patch simply reports the changes to the version of that header in tools/. Quentin Monnet (3): bpf: fix documentation for eBPF helpers bpf: add documentation for helpers bpf_spin_lock(), bpf_spin_unlock() tools: bpf: synchronise BPF UAPI header with tools include/uapi/linux/bpf.h

[PATCH bpf 1/3] bpf: fix documentation for eBPF helpers

2019-03-14 Thread Quentin Monnet
tion of the "bpf_" prefix to bpf_get_storage(). - Light additions of RST markup on some keywords. - Empty line deletion between description and return value for bpf_tcp_sock(). - Edit for the description for bpf_skb_ecn_set_ce() (capital letters, acronym expansion, no effect if ECT not

[PATCH bpf 2/3] bpf: add documentation for helpers bpf_spin_lock(), bpf_spin_unlock()

2019-03-14 Thread Quentin Monnet
list of restrictions is nearly a verbatim copy of the list in Alexei's commit log for those helpers. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- include/uapi/linux/bpf.h | 55 1 file changed, 55 insertions(+) diff --git a/in

Re: [PATCH 1/1] bpftool: Allow referring to maps by its name

2019-03-15 Thread Quentin Monnet
2019-03-15 12:16 UTC-0700 ~ Jakub Kicinski On Fri, 15 Mar 2019 15:41:41 -0300, Arnaldo Carvalho de Melo wrote: While developing 'perf trace' and looking at BPF maps it puts in place I noticed that one needs to first use 'bpftool map' to lookup a map id to then use 'bpftool map dump map id '. T

Re: [PATCH bpf-next 2/2] bpftool: show flow_dissector attachment status

2019-04-24 Thread Quentin Monnet
2019-04-23 16:22 UTC-0700 ~ Stanislav Fomichev Right now there is no way to query whether BPF flow_dissector program is attached to a network namespace or not. In previous commit, I added support for querying that info, show it when doing `bpftool net`: $ bpftool prog loadall ./bpf_flow.o \

Re: [PATCH bpf-next v3 2/2] bpftool: show flow_dissector attachment status

2019-04-24 Thread Quentin Monnet
rent net namespace: $ ip netns add test $ ip netns exec test bpftool net -j [{"xdp":[],"tc":[],"flow_dissector":[]}] Non-json output: $ bpftool net xdp: tc: flow_dissector: id 3 v2: * initialization order (Jakub Kicinski) * clear errno for batch mode (Quentin Monnet) Signed-off-by: Stanislav Fomichev --- Reviewed-by: Quentin Monnet Thanks!

Re: [PATCH v2 bpf-next 3/3] bpftool: add bash completions for btf command

2019-04-25 Thread Quentin Monnet
2019-04-24 22:03 UTC-0700 ~ > From: Andrii Nakryiko > > Add full support for btf command in bash-completion script. > > Cc: Quentin Monnet > Cc: Yonghong Song > Cc: Daniel Borkmann > Cc: Alexei Starovoitov > Signed-off-by: Andrii Nakryiko > --- > tools/bp

Re: [PATCH v2 bpf-next 3/3] bpftool: add bash completions for btf command

2019-04-25 Thread Quentin Monnet
2019-04-25 09:14 UTC-0700 ~ Andrii Nakryiko > On Thu, Apr 25, 2019 at 4:15 AM Quentin Monnet > wrote: >> >> 2019-04-24 22:03 UTC-0700 ~ >>> From: Andrii Nakryiko >>> >>> Add full support for btf command in bash-completion script. >>>

Re: [PATCH v3 bpf-next 0/4] add btf dumping to bpftool

2019-04-25 Thread Quentin Monnet
2019-04-25 09:55 UTC-0700 ~ Andrii Nakryiko This patch set adds a new `bpftool btf dump` sub-command, which allows to dump BTF contents (only types for now). Currently it only outputs low-level content, almost 1:1 with binary BTF format, but follow up patches will add ability to dump BTF types a

Re: [PATCH v3 bpf-next 1/4] bpftool: add ability to dump BTF types

2019-04-25 Thread Quentin Monnet
2019-04-25 09:55 UTC-0700 ~ Andrii Nakryiko Add new `btf dump` sub-command to bpftool. It allows to dump human-readable low-level BTF types representation of BTF types. BTF can be retrieved from few different sources: - from BTF object by ID; - from PROG, if it has associated BTF; - fro

Re: [PATCH v3 bpf-next 3/4] bpftool: add bash completions for btf command

2019-04-25 Thread Quentin Monnet
2019-04-25 09:55 UTC-0700 ~ Andrii Nakryiko Add full support for btf command in bash-completion script. Cc: Quentin Monnet Cc: Yonghong Song Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Andrii Nakryiko --- tools/bpf/bpftool/bash-completion/bpftool | 46

Re: [PATCH v3 bpf-next 2/4] bpftool/docs: add btf sub-command documentation

2019-04-25 Thread Quentin Monnet
2019-04-25 09:55 UTC-0700 ~ Andrii Nakryiko Document usage and sample output format for `btf dump` sub-command. Cc: Daniel Borkmann Cc: Alexei Starovoitov Cc: Yonghong Song Cc: Martin KaFai Lau Cc: Song Liu Cc: Arnaldo Carvalho de Melo Acked-by: Yonghong Song Signed-off-by: Andrii Nakryi

Re: [PATCH v3 bpf-next 4/4] bpftool: fix indendation in bash-completion/bpftool

2019-04-25 Thread Quentin Monnet
2019-04-25 09:55 UTC-0700 ~ Andrii Nakryiko Fix misaligned default case branch for `prog dump` sub-command. Reported-by: Quentin Monnet Cc: Yonghong Song Signed-off-by: Andrii Nakryiko --- tools/bpf/bpftool/bash-completion/bpftool | 22 +++--- 1 file changed, 11

[PATCH bpf-next 2/6] tools: bpftool: add --log-all option to print all possible log info

2019-04-29 Thread Quentin Monnet
The --log-all option is a shortcut for "--log-libbpf warn,info,debug". It tells bpftool to print all possible logs from libbpf, and may be extended in the future to set other log levels from other components as well. This option has a short name: "-l". Signed-off-by: Quentin

[PATCH bpf-next 3/6] libbpf: add bpf_object__load_xattr() API function to pass log_level

2019-04-29 Thread Quentin Monnet
, and so that so that applications relying on libbpf but not calling bpf_prog_load_xattr() can also use that feature. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/libbpf.c | 20 +--- tools/lib/bpf/libbpf.h | 6 ++ tools/lib/bpf/libbpf.map

[PATCH bpf-next 5/6] tools: bpf: report latest changes from BPF UAPI header to tools

2019-04-29 Thread Quentin Monnet
BPF verifier log level flags were moved from an internal header to the UAPI header file. Report the changes accordingly. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/include/uapi/linux/bpf.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/include/uapi

[PATCH bpf-next 6/6] tools: bpftool: add --log-verifier option to print kernel debug logs

2019-04-29 Thread Quentin Monnet
ecause of the way libbpf prints verifier output, the log level for libbpf MUST include "debug" for output from the verifier to be printed when the program loads successfully. The "--log-all" option is updated to set all log level flags for the verifier as well. Signed-off-by: Q

[PATCH bpf-next 0/6] tools: bpftool: add options for debug info from libbpf and verifier

2019-04-29 Thread Quentin Monnet
UAPI headers, in an effort to make it easier to users to pass the value they want. Quentin Monnet (6): tools: bpftool: add --log-libbpf option to get debug info from libbpf tools: bpftool: add --log-all option to print all possible log info libbpf: add bpf_object__load_xattr() API function to

[PATCH bpf-next 4/6] bpf: make BPF_LOG_* flags available in UAPI header

2019-04-29 Thread Quentin Monnet
EL1 | BPF_LOG_STATS. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- include/linux/bpf_verifier.h | 3 --- include/uapi/linux/bpf.h | 5 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h in

[PATCH bpf-next 1/6] tools: bpftool: add --log-libbpf option to get debug info from libbpf

2019-04-29 Thread Quentin Monnet
int ("warn", "info", "debug"). The value corresponding to the default behaviour would be "warn,info". Internally, we simply use the function provided by libbpf to replace the default printing function by one that prints logs for all required levels. Signed-o

Re: [PATCH bpf-next 1/6] tools: bpftool: add --log-libbpf option to get debug info from libbpf

2019-04-30 Thread Quentin Monnet
Hi Yonghong, 2019-04-29 16:32 UTC-0700 ~ Y Song On Mon, Apr 29, 2019 at 2:53 AM Quentin Monnet wrote: libbpf has three levels of priority for output: warn, info, debug. By default, debug output is not printed to stderr. Add a new "--log-libbpf LOG_LEVEL" option to bpftool to pr

Re: bpftool doc man page build failure

2019-05-03 Thread Quentin Monnet
2019-05-03 16:21 UTC+ ~ Yonghong Song > Quentin, > > I hit the following errors with latest bpf-next. > > -bash-4.4$ make man >GEN bpftool-perf.8 >GEN bpftool-map.8 >GEN bpftool.8 >GEN bpftool-net.8 >GEN bpftool-feature.8 >GEN bpftool-pro

Re: [PATCH bpf-next 4/6] bpf: make BPF_LOG_* flags available in UAPI header

2019-05-07 Thread Quentin Monnet
2019-05-04 23:19 UTC-0700 ~ Alexei Starovoitov > On Mon, Apr 29, 2019 at 10:52:25AM +0100, Quentin Monnet wrote: >> The kernel verifier combines several flags to select what kind of logs >> to print to the log buffer provided by users. >> >> In order to make it eas

[PATCH bpf 0/4] bpf: fix documentation for BPF helper functions

2019-05-10 Thread Quentin Monnet
, located under tools/. Quentin Monnet (4): bpf: fix script for generating man page on BPF helpers bpf: fix recurring typo in documentation for BPF helpers bpf: fix minor issues in documentation for BPF helpers. tools: bpf: synchronise BPF UAPI header with tools include/uapi/linux/bpf.h

[PATCH bpf 2/4] bpf: fix recurring typo in documentation for BPF helpers

2019-05-10 Thread Quentin Monnet
"Underlaying packet buffer" should be an "underlying" one, in the warning about invalidated data and data_end pointers. Through copy-and-paste, the typo occurred no fewer than 19 times in the documentation. Let's fix it. Signed-off-by: Quentin Monnet Acked-by: Jakub Ki

[PATCH bpf 3/4] bpf: fix minor issues in documentation for BPF helpers.

2019-05-10 Thread Quentin Monnet
iated with any function or type exposed to the user) in the description of bpf_sk_storage_get() by "full socket". Signed-off-by: Quentin Monnet Acked-by: Jakub Kicinski --- include/uapi/linux/bpf.h | 103 +-- 1 file changed, 54 inserti

[PATCH bpf 1/4] bpf: fix script for generating man page on BPF helpers

2019-05-10 Thread Quentin Monnet
ries of words instead. Reported-by: Yonghong Song Signed-off-by: Quentin Monnet Acked-by: Jakub Kicinski --- scripts/bpf_helpers_doc.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 5010a4d5bfba..8

[PATCH bpf 4/4] tools: bpf: synchronise BPF UAPI header with tools

2019-05-10 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the fixes and additions recently brought to the documentation for the BPF helpers. Signed-off-by: Quentin Monnet Acked-by: Jakub Kicinski --- tools/include/uapi/linux/bpf.h | 145 + 1 file changed, 75

Re: [PATCH bpf-net] bpf: Change bpf_fib_lookup to return lookup status

2018-06-19 Thread Quentin Monnet
Hi David, 2018-06-17 08:18 UTC-0700 ~ dsah...@kernel.org > From: David Ahern > > For ACLs implemented using either FIB rules or FIB entries, the BPF > program needs the FIB lookup status to be able to drop the packet. > Since the bpf_fib_lookup API has not reached a released kernel yet, > change

[PATCH bpf-next 3/3] tools: bpf: build and install man page for eBPF helpers from bpftool/

2018-07-12 Thread Quentin Monnet
e from bpftool directory makes us able to package the helpers man page with bpftool, and to install it along with bpftool documentation, so that the doc for helpers becomes easily available to developers through the "man" program. Cc: linux-...@vger.kernel.org Suggested-by: Daniel Borkm

[PATCH bpf-next 1/3] bpf: fix documentation for eBPF helpers

2018-07-12 Thread Quentin Monnet
Minor formatting edits for eBPF helpers documentation, including blank lines removal, fix of item list for return values in bpf_fib_lookup(), and missing prefix on bpf_skb_load_bytes_relative(). Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- include/uapi/linux/bpf.h | 6

[PATCH bpf-next 2/3] tools: bpf: synchronise BPF UAPI header with tools

2018-07-12 Thread Quentin Monnet
Update with latest changes from include/uapi/linux/bpf.h header. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/include/uapi/linux/bpf.h | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b

[PATCH bpf-next 0/3] bpf: install eBPF helper man page along with bpftool doc

2018-07-12 Thread Quentin Monnet
generating the documentation (man pages) about eBPF helpers. The targets defined in this file can also be called from the bpftool directory (please refer to relevant commit logs for details). Quentin Monnet (3): bpf: fix documentation for eBPF helpers tools: bpf: synchronise BPF UAPI header

[RFC bpf-next] bpf: document eBPF helpers and add a script to generate man page

2018-04-06 Thread Quentin Monnet
I can offer no guaranty at this time that they would accept to take the generated man page. Cc: linux-...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 2237 scripts/bpf_helpers_doc.py

Re: [RFC bpf-next] bpf: document eBPF helpers and add a script to generate man page

2018-04-09 Thread Quentin Monnet
2018-04-09 11:01 UTC+0200 ~ Daniel Borkmann > On 04/06/2018 01:11 PM, Quentin Monnet wrote: >> eBPF helper functions can be called from within eBPF programs to perform >> a variety of tasks that would be otherwise hard or impossible to do with >> eBPF itself. There is a g

Re: [RFC bpf-next] bpf: document eBPF helpers and add a script to generate man page

2018-04-09 Thread Quentin Monnet
2018-04-09 12:52 UTC+0200 ~ Markus Heiser > >> Am 09.04.2018 um 12:08 schrieb Daniel Borkmann : > [...] > >>> May I completely misunderstood you, so correct my if I'am wrong: >>> >>> - ./scripts/bpf_helpers_doc.py : produces reST markup from C-comments >>> - ./scripts/kerne-doc : produc

Re: [RFC bpf-next] bpf: document eBPF helpers and add a script to generate man page

2018-04-10 Thread Quentin Monnet
2018-04-09 18:47 UTC-0700 ~ Alexei Starovoitov > On Mon, Apr 09, 2018 at 02:25:26PM +0100, Quentin Monnet wrote: >> >> Anyway, I am fine with keeping just signatures, descriptions and return >> values for now. I will submit a new version with only those items. > > Tha

[RFC bpf-next v2 0/8] bpf: document eBPF helpers and add a script to generate man page

2018-04-10 Thread Quentin Monnet
documentation is supposed to be processed. - Update Python script accordingly (remove the same sections, and remove paragraphs on program types and GPL restrictions from man page header). - Split series into several patches. Cc: linux-...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-

[RFC bpf-next v2 1/8] bpf: add script and prepare bpf.h for new helpers documentation

2018-04-10 Thread Quentin Monnet
not available directly in the header files (pre-processor directives are used to produce them at the beginning of the compilation process). Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 406 ++-- scripts/bpf_helpers_doc.py | 414

[RFC bpf-next v2 5/8] bpf: add documentation for eBPF helpers (33-41)

2018-04-10 Thread Quentin Monnet
() - bpf_get_numa_node_id() - bpf_set_hash() - bpf_skb_adjust_room() - bpf_xdp_adjust_meta() Cc: Daniel Borkmann Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 155 +++ 1 file changed, 155 insertions(+) diff --git a/include/uapi/linux/bpf.h b

[RFC bpf-next v2 6/8] bpf: add documentation for eBPF helpers (42-50)

2018-04-10 Thread Quentin Monnet
Borello Cc: Chenbo Feng Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 158 +++ 1 file changed, 158 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index af429ec79f50..15d9ccafebbe 100644 --- a/include/uapi

[RFC bpf-next v2 7/8] bpf: add documentation for eBPF helpers (51-57)

2018-04-10 Thread Quentin Monnet
() - bpf_perf_prog_read_value() Helper from Josef: - bpf_override_return() Helper from Andrey: - bpf_bind() Cc: Lawrence Brakmo Cc: Yonghong Song Cc: Josef Bacik Cc: Andrey Ignatov Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 184

[RFC bpf-next v2 2/8] bpf: add documentation for eBPF helpers (01-11)

2018-04-10 Thread Quentin Monnet
() - bpf_trace_printk() - bpf_skb_store_bytes() - bpf_l3_csum_replace() - bpf_l4_csum_replace() - bpf_tail_call() - bpf_clone_redirect() Cc: Alexei Starovoitov Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 199 +++ 1 file changed, 199 insertions

[RFC bpf-next v2 8/8] bpf: add documentation for eBPF helpers (58-64)

2018-04-10 Thread Quentin Monnet
() - bpf_msg_cork_bytes() - bpf_msg_pull_data() Cc: John Fastabend Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 140 +++ 1 file changed, 140 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 7343af4196c8

[RFC bpf-next v2 4/8] bpf: add documentation for eBPF helpers (23-32)

2018-04-10 Thread Quentin Monnet
() - bpf_skb_load_bytes() - bpf_csum_diff() - bpf_skb_get_tunnel_opt() - bpf_skb_set_tunnel_opt() - bpf_skb_change_proto() - bpf_skb_change_type() Cc: Daniel Borkmann Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 125 +++ 1 file changed, 125 insertions

[RFC bpf-next v2 3/8] bpf: add documentation for eBPF helpers (12-22)

2018-04-10 Thread Quentin Monnet
() - bpf_skb_get_tunnel_key() - bpf_skb_set_tunnel_key() - bpf_redirect() - bpf_perf_event_output() - bpf_get_stackid() - bpf_get_current_task() Cc: Alexei Starovoitov Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 237 +++ 1 file changed

[RFC bpf-next v2 1/8] bpf: add script and prepare bpf.h for new helpers documentation

2018-04-11 Thread Quentin Monnet
2018-04-10 11:16 UTC-0700 ~ Alexei Starovoitov > On Tue, Apr 10, 2018 at 03:41:50PM +0100, Quentin Monnet wrote: >> Remove previous "overview" of eBPF helpers from user bpf.h header. >> Replace it by a comment explaining how to process the new documentation >> (to

[RFC bpf-next v2 2/8] bpf: add documentation for eBPF helpers (01-11)

2018-04-11 Thread Quentin Monnet
2018-04-10 10:56 UTC-0700 ~ Alexei Starovoitov > On Tue, Apr 10, 2018 at 03:41:51PM +0100, Quentin Monnet wrote: >> Add documentation for eBPF helper functions to bpf.h user header file. >> This documentation can be parsed with the Python script provided in >> another commi

[RFC bpf-next v2 3/8] bpf: add documentation for eBPF helpers (12-22)

2018-04-11 Thread Quentin Monnet
2018-04-10 15:43 UTC-0700 ~ Alexei Starovoitov > On Tue, Apr 10, 2018 at 03:41:52PM +0100, Quentin Monnet wrote: >> Add documentation for eBPF helper functions to bpf.h user header file. >> This documentation can be parsed with the Python script provided in >> another commi

[RFC bpf-next v2 7/8] bpf: add documentation for eBPF helpers (51-57)

2018-04-11 Thread Quentin Monnet
2018-04-10 09:58 UTC-0700 ~ Yonghong Song > On 4/10/18 7:41 AM, Quentin Monnet wrote: >> Add documentation for eBPF helper functions to bpf.h user header file. >> This documentation can be parsed with the Python script provided in >> another commit of the patch series, in o

[RFC bpf-next v2 7/8] bpf: add documentation for eBPF helpers (51-57)

2018-04-11 Thread Quentin Monnet
2018-04-10 10:50 UTC-0700 ~ Andrey Ignatov > Quentin Monnet [Tue, 2018-04-10 07:43 -0700]: >> + * int bpf_bind(struct bpf_sock_addr_kern *ctx, struct sockaddr *addr, int >> addr_len) >> + * Description >> + * Bind the socket associated to *ctx

[RFC bpf-next v2 8/8] bpf: add documentation for eBPF helpers (58-64)

2018-04-11 Thread Quentin Monnet
2018-04-11 12:17 UTC+0200 ~ Jesper Dangaard Brouer > On Tue, 10 Apr 2018 15:41:57 +0100 > Quentin Monnet wrote: > >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index 7343af4196c8..db090ad03626 100644 >> --- a/include/uapi/linux/bpf.h >&g

Re: [RFC bpf-next v2 7/8] bpf: add documentation for eBPF helpers (51-57)

2018-04-11 Thread Quentin Monnet
2018-04-11 16:44 UTC+0100 ~ Quentin Monnet > 2018-04-10 09:58 UTC-0700 ~ Yonghong Song >> On 4/10/18 7:41 AM, Quentin Monnet wrote: >>> Add documentation for eBPF helper functions to bpf.h user header file. >>> This documentation can be parsed with the Python scr

Re: [RFC bpf-next v2 4/8] bpf: add documentation for eBPF helpers (23-32)

2018-04-13 Thread Quentin Monnet
2018-04-12 17:28 UTC-0700 ~ Alexei Starovoitov > On Tue, Apr 10, 2018 at 03:41:53PM +0100, Quentin Monnet wrote: >> Add documentation for eBPF helper functions to bpf.h user header file. >> This documentation can be parsed with the Python script provided in >> another commi

Re: [PATCH bpf-next 1/3] bpftool: Add missing prog types and attach types

2018-04-17 Thread Quentin Monnet
2018-04-16 16:57 UTC-0700 ~ Andrey Ignatov > Jakub Kicinski [Mon, 2018-04-16 16:53 -0700]: >> On Mon, 16 Apr 2018 14:41:57 -0700, Andrey Ignatov wrote: >>> diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c >>> index cae32a6..8689916 100644 >>> --- a/tools/bpf/bpftool/cgroup.c >

[PATCH bpf-next v3 0/8] bpf: document eBPF helpers and add a script to generate man page

2018-04-17 Thread Quentin Monnet
essed. - Update Python script accordingly (remove the same sections, and remove paragraphs on program types and GPL restrictions from man page header). - Split series into several patches. Cc: linux-...@vger.kernel.org Cc: linux-...@vger.kernel.org Quentin Monnet (8): bpf: add script and

[PATCH bpf-next v3 1/8] bpf: add script and prepare bpf.h for new helpers documentation

2018-04-17 Thread Quentin Monnet
s" in man page header text. - Move and fix comment on helpers introducing no overhead. - Remove "NOTES" section from man page footer. - Add "LICENSE" section to man page footer. - Edit description of file include/uapi/linux/bpf.h in

[PATCH bpf-next v3 4/8] bpf: add documentation for eBPF helpers (23-32)

2018-04-17 Thread Quentin Monnet
(): State that CONFIG_CGROUP_NET_CLASSID is required to use this helper. - bpf_skb_load_bytes(): Fix comment on current use cases for the helper. Cc: Daniel Borkmann Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 152 +++ 1 file changed

[PATCH bpf-next v3 3/8] bpf: add documentation for eBPF helpers (12-22)

2018-04-17 Thread Quentin Monnet
. - bpf_perf_event_output(): Fix first sentence of description. Delete wrong statement on context being evaluated as a struct pt_reg. Remove the long yet incomplete example. - bpf_get_stackid(): Add a note about PERF_MAX_STACK_DEPTH being configurable. Cc: Alexei Starovoitov Signed-off-by: Quentin Monnet

[PATCH bpf-next v3 2/8] bpf: add documentation for eBPF helpers (01-11)

2018-04-17 Thread Quentin Monnet
: Quentin Monnet --- include/uapi/linux/bpf.h | 210 +++ 1 file changed, 210 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 45f77f01e672..02b7d522b3c0 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux

[PATCH bpf-next v3 5/8] bpf: add documentation for eBPF helpers (33-41)

2018-04-17 Thread Quentin Monnet
() - bpf_get_numa_node_id() - bpf_set_hash() - bpf_skb_adjust_room() - bpf_xdp_adjust_meta() Cc: Daniel Borkmann Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 155 +++ 1 file changed, 155 insertions(+) diff --git a/include/uapi/linux/bpf.h b

<    1   2   3   4   5   6   >