[PATCH bpf-next v2 0/3] tools: bpftool: add an option for debug output from libbpf and verifier

2019-05-23 Thread Quentin Monnet
for now, so bpftool-prog.rst and bpftool.rst remain the only pages updated in that regard. Previous discussion available at: https://lore.kernel.org/bpf/20190429095227.9745-1-quentin.mon...@netronome.com/ Quentin Monnet (3): tools: bpftool: add -d option to get debug output from

[PATCH bpf-next v2 1/3] tools: bpftool: add -d option to get debug output from libbpf

2019-05-23 Thread Quentin Monnet
d|--debug. - Add option description to all bpftool manual pages (instead of bpftool-prog.rst only), as all commands use libbpf. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Documentation/bpftool-btf.rst| 4 tools/bpf/bpftool/Documentation/bpftool-c

[PATCH bpf-next v2 3/3] tools: bpftool: make -d option print debug output from verifier

2019-05-23 Thread Quentin Monnet
;log_level1", "log_level2" and "stats"). - The macros from kernel header bpf_verifier.h are not used (and therefore not moved to UAPI header). - In v1 this was a distinct option, but is now merged in the only "-d" switch to activate libbpf and verifier debu

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

2019-05-23 Thread Quentin Monnet
, and so that so that applications relying on libbpf but not calling bpf_prog_load_xattr() can also use that feature. v2: - We are in a new cycle, bump libbpf extraversion number. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/Makefile | 2 +- tools/lib/bpf

Re: [PATCH v2 bpf-next 11/12] bpftool/docs: add description of btf dump C option

2019-05-24 Thread Quentin Monnet
2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko > Document optional **c** option for btf dump subcommand. > > Cc: Quentin Monnet > Signed-off-by: Andrii Nakryiko > --- > tools/bpf/bpftool/Documentation/bpftool-btf.rst | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion

Re: [PATCH v2 bpf-next 10/12] bpftool: add C output format option to btf dump subcommand

2019-05-24 Thread Quentin Monnet
Hi Andrii, Some nits inline, nothing blocking though. 2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko > Utilize new libbpf's btf_dump API to emit BTF as a C definitions. > > Signed-off-by: Andrii Nakryiko > --- > tools/bpf/bpftool/btf.c | 74 +++-- > 1 file cha

Re: [PATCH v2 bpf-next 12/12] bpftool: update bash-completion w/ new c option for btf dump

2019-05-24 Thread Quentin Monnet
2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko > Add bash completion for new C btf dump option. > > Cc: Quentin Monnet > Signed-off-by: Andrii Nakryiko > --- > tools/bpf/bpftool/bash-completion/bpftool | 25 +++ > 1 file changed, 21 insertions(+), 4 d

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

2019-05-24 Thread Quentin Monnet
2019-05-23 16:29 UTC+ ~ Yonghong Song > > > On 5/23/19 9:19 AM, Yonghong Song wrote: >> >> >> On 5/23/19 3:54 AM, Quentin Monnet wrote: >>> libbpf was recently made aware of the log_level attribute for programs, >>> used to specify the leve

Re: [PATCH bpf-next v2 3/3] tools: bpftool: make -d option print debug output from verifier

2019-05-24 Thread Quentin Monnet
2019-05-23 16:38 UTC+ ~ Yonghong Song > > > On 5/23/19 3:54 AM, Quentin Monnet wrote: >> The "-d" option is used to require all logs available for bpftool. So >> far it meant telling libbpf to print even debug-level information. But >> there is another

Re: [PATCH bpf-next v2 1/3] tools: bpftool: add -d option to get debug output from libbpf

2019-05-24 Thread Quentin Monnet
2019-05-23 13:57 UTC-0700 ~ Andrii Nakryiko > On Thu, May 23, 2019 at 1:44 PM Jakub Kicinski > wrote: >> >> On Thu, 23 May 2019 09:20:52 -0700, Andrii Nakryiko wrote: >>> On Thu, May 23, 2019 at 3:54 AM Quentin Monnet wrote: >>>> >>>> libbpf has

[PATCH bpf-next v3 1/3] tools: bpftool: add -d option to get debug output from libbpf

2019-05-24 Thread Quentin Monnet
d|--debug. - Add option description to all bpftool manual pages (instead of bpftool-prog.rst only), as all commands use libbpf. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Documentation/bpftool-btf.rst| 4 tools/bpf/bpftool/Documentation/bpftool-c

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

2019-05-24 Thread Quentin Monnet
he desired log level. v3: - Rewrite commit log. v2: - We are in a new cycle, bump libbpf extraversion number. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/lib/bpf/Makefile | 2 +- tools/lib/bpf/libbpf.c | 20 +--- tools/lib/bpf/libbpf.h | 6 ++

[PATCH bpf-next v3 0/3] tools: bpftool: add an option for debug output from libbpf and verifier

2019-05-24 Thread Quentin Monnet
7.9745-1-quentin.mon...@netronome.com/ Quentin Monnet (3): tools: bpftool: add -d option to get debug output from libbpf libbpf: add bpf_object__load_xattr() API function to pass log_level tools: bpftool: make -d option print debug output from verifier .../bpf/bpftool/Documentation/bpftool-btf.rst |

[PATCH bpf-next v3 3/3] tools: bpftool: make -d option print debug output from verifier

2019-05-24 Thread Quentin Monnet
verifier.h are not used (and therefore not moved to UAPI header). - In v1 this was a distinct option, but is now merged in the only "-d" switch to activate libbpf and verifier debug-level logs all at the same time. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- ..

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

2019-05-24 Thread Quentin Monnet
2019-05-24 13:22 UTC+0200 ~ Jesper Dangaard Brouer > On Fri, 24 May 2019 11:36:47 +0100 > Quentin Monnet wrote: > >> libbpf was recently made aware of the log_level attribute for programs, >> used to specify the level of information expected to be dumped by the

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

2019-05-24 Thread Quentin Monnet
2019-05-24 14:49 UTC+0200 ~ Jesper Dangaard Brouer > On Fri, 24 May 2019 12:51:14 +0100 > Quentin Monnet wrote: > >> 2019-05-24 13:22 UTC+0200 ~ Jesper Dangaard Brouer >>> On Fri, 24 May 2019 11:36:47 +0100 >>> Quentin Monnet wrote: >>> >>&g

Re: [PATCH v2 bpf-next 10/12] bpftool: add C output format option to btf dump subcommand

2019-05-24 Thread Quentin Monnet
2019-05-24 10:14 UTC-0700 ~ Andrii Nakryiko > On Fri, May 24, 2019 at 2:14 AM Quentin Monnet > wrote: >> >> Hi Andrii, >> >> Some nits inline, nothing blocking though. >> >> 2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko >>> Utilize new l

Re: [PATCH v2 bpf-next 12/12] bpftool: update bash-completion w/ new c option for btf dump

2019-05-24 Thread Quentin Monnet
2019-05-24 11:10 UTC-0700 ~ Andrii Nakryiko > On Fri, May 24, 2019 at 2:15 AM Quentin Monnet > wrote: >> >> 2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko >>> Add bash completion for new C btf dump option. >>> >>> Cc: Quentin Monnet >>>

Re: [PATCH v2 bpf-next 11/12] bpftool/docs: add description of btf dump C option

2019-05-24 Thread Quentin Monnet
2019-05-24 10:25 UTC-0700 ~ Andrii Nakryiko > On Fri, May 24, 2019 at 2:14 AM Quentin Monnet > wrote: >> >> 2019-05-23 13:42 UTC-0700 ~ Andrii Nakryiko >>> Document optional **c** option for btf dump subcommand. >>> >>> Cc: Quentin Monnet >>&

Re: [PATCH v3 bpf-next 11/12] bpftool/docs: add description of btf dump C option

2019-05-24 Thread Quentin Monnet
2019-05-24 11:59 UTC-0700 ~ Andrii Nakryiko > Document optional **c** option for btf dump subcommand. > > Cc: Quentin Monnet > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH v3 bpf-next 12/12] bpftool: update bash-completion w/ new c option for btf dump

2019-05-24 Thread Quentin Monnet
2019-05-24 11:59 UTC-0700 ~ Andrii Nakryiko > Add bash completion for new C btf dump option. > > Cc: Quentin Monnet > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH v3 bpf-next 10/12] bpftool: add C output format option to btf dump subcommand

2019-05-24 Thread Quentin Monnet
2019-05-24 11:59 UTC-0700 ~ Andrii Nakryiko > Utilize new libbpf's btf_dump API to emit BTF as a C definitions. > > Acked-by: Jakub Kicinski > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Thanks for the changes!

Re: [PATCH bpf-next] bpftool: auto-complete BTF IDs for btf dump

2019-05-25 Thread Quentin Monnet
> Suggested-by: Quentin Monnet > Signed-off-by: Andrii Nakryiko > --- > tools/bpf/bpftool/bash-completion/bpftool | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/tools/bpf/bpftool/bash-completion/bpftool > b/tools/bpf/bpftool/bash-completion/bpftool &g

Re: [PATCH bpf-next] bpftool: auto-complete BTF IDs for btf dump

2019-05-28 Thread Quentin Monnet
> Suggested-by: Quentin Monnet > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Thanks!

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

2019-05-29 Thread Quentin Monnet
2019-05-28 17:35 UTC-0700 ~ Alexei Starovoitov > On Fri, May 24, 2019 at 3:36 AM Quentin Monnet > wrote: >> >> libbpf was recently made aware of the log_level attribute for programs, >> used to specify the level of information expected to be dumped by t

[PATCH bpf-next] libbpf: prevent overwriting of log_level in bpf_object__load_progs()

2019-05-29 Thread Quentin Monnet
_level in bpf_object__load_progs(), instead of overwriting it. Fixes: 60276f984998 ("libbpf: add bpf_object__load_xattr() API function to pass log_level") Reported-by: Alexei Starovoitov Signed-off-by: Quentin Monnet --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

Re: [oss-drivers] Re: [PATCH bpf-next] libbpf: prevent overwriting of log_level in bpf_object__load_progs()

2019-05-29 Thread Quentin Monnet
2019-05-29 16:03 UTC+0200 ~ Daniel Borkmann > On 05/29/2019 11:23 AM, Quentin Monnet wrote: >> There are two functions in libbpf that support passing a log_level >> parameter for the verifier for loading programs: >> bpf_object__load_xattr() and bpf_load_program_xa

[PATCH bpf-next v2] libbpf: prevent overwriting of log_level in bpf_object__load_progs()

2019-05-29 Thread Quentin Monnet
OR-ing the log_level in bpf_object__load_progs(), instead of overwriting it. v2: Fix commit log description (confusion on function names in v1). Fixes: 60276f984998 ("libbpf: add bpf_object__load_xattr() API function to pass log_level") Reported-by: Alexei Starovoitov Signed-off-by:

Re: [PATCH] tools: bpftool: fix reading from /proc/config.gz

2019-08-05 Thread Quentin Monnet
ekable. This also fixes a file handle leak on some error paths. > > Fixes: 4567b983f78c ("tools: bpftool: add probes for kernel configuration > options") > Cc: Quentin Monnet > Signed-off-by: Peter Wu > --- > tools/bpf/bpftool/feature.c | 92

Re: [PATCH] tools: bpftool: fix reading from /proc/config.gz

2019-08-06 Thread Quentin Monnet
Hi Peter, 2019-08-06 00:54 UTC+0100 ~ Peter Wu > Hi all, > > Thank you for your quick feedback, I will address them in the next > revision. > > On Mon, Aug 05, 2019 at 11:41:09AM +0100, Quentin Monnet wrote: > >> As far as I understood (from examining Cilium [0]), /

Re: [v3,3/4] tools: bpftool: add bash-completion for net attach/detach

2019-08-08 Thread Quentin Monnet
ev", thanks! But it seems you missed one place where it was used, for "bpftool feature probe" (We have "[[ $prev == "dev" ]] && _sysfs_get_netdevs && return 0"). Could you also remove that one please? Other than this looks good, thanks: Reviewed-by: Quentin Monnet

Re: [v3,4/4] tools: bpftool: add documentation for net attach/detach

2019-08-08 Thread Quentin Monnet
2019-08-07 11:25 UTC+0900 ~ Daniel T. Lee > Since, new sub-command 'net attach/detach' has been added for > attaching XDP program on interface, > this commit documents usage and sample output of `net attach/detach`. > > Signed-off-by: Daniel T. Lee > --- > .../bpf/bpftool/Documentation/bpftool-

Re: [PATCH v3] tools: bpftool: fix reading from /proc/config.gz

2019-08-09 Thread Quentin Monnet
e operations since the latter transparently handles > uncompressed and gzip-compressed files. > > Cc: Quentin Monnet > Signed-off-by: Peter Wu > --- > v3: replace popen(gunzip) by linking directly to zlib. Reword commit > message, remove "Fixes" line. (this patch

[RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-13 Thread Quentin Monnet
hen entries are being added/removed in parallel from the BPF program, and having another dedicated command accessible from the bpf() system call might help here as well. Quentin Monnet (3): tools: bpftool: clean up dump_map_elem() return value tools: bpftool: make comment more explicit for

[RFC bpf-next 2/3] tools: bpftool: make comment more explicit for count of dumped entries

2019-08-13 Thread Quentin Monnet
-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 206ee46189d9..cead639b3ab1 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c

[RFC bpf-next 3/3] tools: bpftool: add "bpftool map count" to count entries in map

2019-08-13 Thread Quentin Monnet
(beyond max_entries), as these types do not support cycling over the keys. This commit also adds relevant documentation and bash completion. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- .../bpf/bpftool/Documentation/bpftool-map.rst | 15 +++ tools/bpf/bpftool/bash-completion/bpft

[RFC bpf-next 1/3] tools: bpftool: clean up dump_map_elem() return value

2019-08-13 Thread Quentin Monnet
his is more correct, and more consistent with the rest of the code. It is unclear if an error value should indeed be returned for maps of maps or maps of progs, but this has no effect on the output either, so we just leave the current behaviour unchanged. Signed-off-by: Quentin Monnet Reviewed-by:

Re: [RFC PATCH] bpf: preload: Fix build error when O= is set

2020-12-16 Thread Quentin Monnet
2020-11-21 17:48 UTC+0800 ~ David Gow > On Sat, Nov 21, 2020 at 3:38 PM Andrii Nakryiko > wrote: >> >> On Thu, Nov 19, 2020 at 12:51 AM David Gow wrote: >>> >>> If BPF_PRELOAD is enabled, and an out-of-tree build is requested with >>> make O=, compilation seems to fail with: >>> >>> tools/script

Re: [PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread Quentin Monnet
On 09/11/2020 07:04, Wang Hai wrote: > progfd is created by prog_parse_fd(), before 'bpftool net attach' exit, > it should be closed. > > Fixes: 04949ccc273e ("tools: bpftool: add net attach command to attach XDP on > interface") > Signed-off-by: Wang Hai

Re: [PATCH v3 bpf-next] Add CONFIG_DEBUG_INFO_BTF check to bpftool feature command

2021-02-22 Thread Quentin Monnet
ALWAYS_ON", }, > + /* Kernel BTF debug information available */ > + { "CONFIG_DEBUG_INFO_BTF", }, > > /* cgroups */ > { "CONFIG_CGROUPS", }, > Thanks for the change! Reviewed-by: Quentin Monnet (Note: the dat

Re: [PATCH bpf-next] bpf: fix missing * in bpf.h

2021-02-26 Thread Quentin Monnet
2021-02-24 10:59 UTC-0800 ~ Andrii Nakryiko > On Wed, Feb 24, 2021 at 7:55 AM Daniel Borkmann wrote: >> >> On 2/23/21 3:43 PM, Jesper Dangaard Brouer wrote: >>> On Tue, 23 Feb 2021 20:45:54 +0800 >>> Hangbin Liu wrote: >>> Commit 34b2021cc616 ("bpf: Add BPF-helper for MTU checking") lost a

Re: [PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-15 Thread Quentin Monnet
2021-04-15 16:37 UTC+0200 ~ Daniel Borkmann > On 4/15/21 11:32 AM, Jianlin Lv wrote: >> For debugging JITs, dumping the JITed image to kernel log is discouraged, >> "bpftool prog dump jited" is much better way to examine JITed dumps. >> This patch get rid of the code related to bpf_jit_enable=2 mo

[PATCH] bpf: fix build for BPF preload when $(O) points to a relative path

2021-01-25 Thread Quentin Monnet
19085022.3606135-1-david...@google.com/t/#u Cc: Andrii Nakryiko Cc: Brendan Higgins Cc: David Gow Reported-by: David Gow Signed-off-by: Quentin Monnet --- kernel/bpf/preload/Makefile | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/preload/Makefile b/kernel/b

Re: [PATCH] bpf: fix build for BPF preload when $(O) points to a relative path

2021-01-26 Thread Quentin Monnet
2021-01-25 16:32 UTC-0800 ~ Andrii Nakryiko > On Mon, Jan 25, 2021 at 7:49 AM Quentin Monnet wrote: >> >> Building the kernel with CONFIG_BPF_PRELOAD, and by providing a relative >> path for the output directory, may fail with the following error: >> >

Re: [PATCH] bpf: fix build for BPF preload when $(O) points to a relative path

2021-01-26 Thread Quentin Monnet
2021-01-26 11:24 UTC+ ~ Quentin Monnet > 2021-01-25 16:32 UTC-0800 ~ Andrii Nakryiko >> On Mon, Jan 25, 2021 at 7:49 AM Quentin Monnet wrote: >>> >>> Building the kernel with CONFIG_BPF_PRELOAD, and by providing a relative >>> path for the output director

[PATCH bpf v2] bpf: fix build for BPF preload when $(O) points to a relative path

2021-01-26 Thread Quentin Monnet
y that Makefile. David Gow previously posted a slightly different version of this patch as a RFC [0], two months ago or so. [0] https://lore.kernel.org/bpf/20201119085022.3606135-1-david...@google.com/t/#u v2: Use $(LIBBPF_OUT) instead of $(abspath .), and improve commit log Cc: Andrii Nakryiko Cc:

Re: [PATCH bpf-next 07/10] bpftool: add `gen bpfo` command to perform BPF static linking

2021-03-11 Thread Quentin Monnet
2021-03-09 20:04 UTC-0800 ~ Andrii Nakryiko > Add `bpftool gen bpfo ...` command to statically > link multiple BPF object files into a single output BPF object file. > > Similarly to existing '*.o' convention, bpftool is establishing a '*.bpfo' > convention for statically-linked BPF object files

Re: [PATCH bpf-next 07/10] bpftool: add `gen bpfo` command to perform BPF static linking

2021-03-12 Thread Quentin Monnet
2021-03-11 10:45 UTC-0800 ~ Andrii Nakryiko > On Thu, Mar 11, 2021 at 3:31 AM Quentin Monnet wrote: >> >> 2021-03-09 20:04 UTC-0800 ~ Andrii Nakryiko >>> Add `bpftool gen bpfo ...` command to statically >>> link multiple BPF object files into a single output B

Re: [PATCH bpf-next 07/10] bpftool: add `gen bpfo` command to perform BPF static linking

2021-03-13 Thread Quentin Monnet
On Sat, 13 Mar 2021 at 18:37, Andrii Nakryiko wrote: > > On Fri, Mar 12, 2021 at 10:07 AM Quentin Monnet wrote: > > > > 2021-03-11 10:45 UTC-0800 ~ Andrii Nakryiko > > > On Thu, Mar 11, 2021 at 3:31 AM Quentin Monnet > > > wrote: > > >> &g

Re: [PATCH v2 bpf-next 08/11] bpftool: add `gen object` command to perform BPF static linking

2021-03-15 Thread Quentin Monnet
- "$cur" ) ) +COMPREPLY=( $( compgen -W 'object skeleton help' -- "$cur" ) ) ;; esac ;; -- Looks good otherwise. Thanks for the documentation, it's great to have the example in the man page. Pending the two nits above are fixed: Reviewed-by: Quentin Monnet Quentin

Re: [PATCH bpf-next 0/2] Fix BPF helpers documentation

2018-04-29 Thread Quentin Monnet
> include/uapi/linux/bpf.h | 12 ++-- > tools/include/uapi/linux/bpf.h | 12 ++-- > 2 files changed, 12 insertions(+), 12 deletions(-) Correct. Thanks a lot for the fix, Andrey! Reviewed-by: Quentin Monnet

[PATCH bpf-next 0/3] bpf: fix formatting for eBPF helper doc

2018-04-30 Thread Quentin Monnet
is fine, but description and return value appear as empty). There is no change to text contents in this set. Quentin Monnet (3): bpf: fix formatting for bpf_perf_event_read() helper doc bpf: fix formatting for bpf_get_stack() helper documentation bpf: update bpf.h uapi header for tools

[PATCH bpf-next 3/3] bpf: update bpf.h uapi header for tools

2018-04-30 Thread Quentin Monnet
Bring fixes for eBPF helper documentation formatting to bpf.h under tools/ as well. Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 62 +- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b

[PATCH bpf-next 1/3] bpf: fix formatting for bpf_perf_event_read() helper doc

2018-04-30 Thread Quentin Monnet
. Fixes: c6b5fb8690fa ("bpf: add documentation for eBPF helpers (42-50)") Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 23b334bba1a6..530ff6588

[PATCH bpf-next 2/3] bpf: fix formatting for bpf_get_stack() helper doc

2018-04-30 Thread Quentin Monnet
Fix formatting (indent) for bpf_get_stack() helper documentation, so that the doc is rendered correctly with the Python script. Fixes: c195651e565a ("bpf: add bpf_get_stack helper") Cc: Yonghong Song Signed-off-by: Quentin Monnet --- Note: The error was a missing space between the &

Re: [PATCH bpf-next 2/3] bpf: fix formatting for bpf_get_stack() helper doc

2018-04-30 Thread Quentin Monnet
2018-04-30 09:12 UTC-0600 ~ David Ahern > On 4/30/18 9:08 AM, Alexei Starovoitov wrote: >>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >>> index 530ff6588d8f..8daef7326bb7 100644 >>> --- a/include/uapi/linux/bpf.h >>> +++ b/include/uapi/linux/bpf.h >>> @@ -1770,33 +1770,33 @@

[PATCH bpf-next] bpf: relax constraints on formatting for eBPF helper documentation

2018-04-30 Thread Quentin Monnet
on *.>> Start of description... *> > Another line of description *..And yet another line of description *> Return *.>0 on success, or a negative error in case of failure ... */ Signed-off-by: Quentin Mo

Re: [PATCH bpf-next] bpf: relax constraints on formatting for eBPF helper documentation

2018-04-30 Thread Quentin Monnet
2018-04-30 17:33 UTC+0100 ~ Edward Cree > On 30/04/18 16:59, Quentin Monnet wrote: >> The Python script used to parse and extract eBPF helpers documentation >> from include/uapi/linux/bpf.h expects a very specific formatting for the >> descriptions (single dots represent a sp

[PATCH bpf-nex] tools: bpftool: change time format for program 'loaded at:' information

2018-05-01 Thread Quentin Monnet
"ns_inode": 4026531993, "ifname": "foo" }, "loaded_at": 1524068387, "uid": 0, "bytes_xlated": 16, "jited": false, "bytes_meml

[PATCH bpf-next v2] bpf: relax constraints on formatting for eBPF helper documentation

2018-05-02 Thread Quentin Monnet
essary carets from each regex used with match() in the script. They are redundant, as match() tries to match from the beginning of the string by default. v2: Remove unnecessary caret when a regex is used with match(). Signed-off-by: Quentin Monnet --- scripts/bpf_helpers_doc.py | 14 +++---

Re: [PATCH bpf-next v4 3/4] bpf: selftest additions for SOCKHASH

2018-05-04 Thread Quentin Monnet
2018-05-03 11:28:27 UTC-0700 ~ John Fastabend > This runs existing SOCKMAP tests with SOCKHASH map type. To do this > we push programs into include file and build two BPF programs. One > for SOCKHASH and one for SOCKMAP. > > We then run the entire test suite with each type. > > Signed-off-by: Jo

Re: [PATCH bpf-next v3 8/8] bpf: add documentation for eBPF helpers (58-64)

2018-04-18 Thread Quentin Monnet
2018-04-18 15:34 UTC+0200 ~ Jesper Dangaard Brouer > On Tue, 17 Apr 2018 15:34:38 +0100 > Quentin Monnet wrote: > >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index 350459c583de..3d329538498f 100644 >> --- a/include/uapi/linux/bpf.h >&g

Re: [PATCH bpf-next v3 8/8] bpf: add documentation for eBPF helpers (58-64)

2018-04-19 Thread Quentin Monnet
2018-04-18 17:43 UTC+0200 ~ Jesper Dangaard Brouer > On Wed, 18 Apr 2018 15:09:41 +0100 > Quentin Monnet wrote: > >> 2018-04-18 15:34 UTC+0200 ~ Jesper Dangaard Brouer >>> On Tue, 17 Apr 2018 15:34:38 +0100 >>> Quentin Monnet wrote: >>> >>&g

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

2018-04-20 Thread Quentin Monnet
2018-04-19 13:16 UTC+0200 ~ Daniel Borkmann > On 04/17/2018 04:34 PM, 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,

Re: How to detect libbfd when building tools/bpf?

2018-04-25 Thread Quentin Monnet
2018-04-24 10:27 UTC+0800 ~ shhuiw > > > On 04/23/18 18:05, Daniel Borkmann wrote: >> On 04/22/2018 09:51 AM, Wang Sheng-Hui wrote: >>> Sorry to trouble you ! >>> >>> I run debian and installed binutils-dev beforehand. >>> Then I copied tools/build/feature/test-libbfd.c to t.c and run: >>> -

[PATCH bpf-next v4 00/10] bpf: document eBPF helpers and add a script to generate man page

2018-04-25 Thread Quentin Monnet
mment on top of the description list to explain how this 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-...@vge

[PATCH bpf-next v4 01/10] bpf: add script and prepare bpf.h for new helpers documentation

2018-04-25 Thread Quentin Monnet
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 man page footer. Signed-off-by: Quentin Monn

[PATCH bpf-next v4 04/10] bpf: add documentation for eBPF helpers (23-32)

2018-04-25 Thread Quentin Monnet
g a task in net_cls controller disables cgroup-bpf. - bpf_get_route_realm(): 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 Acked-by: Alexei Starovoitov

[PATCH bpf-next v4 08/10] bpf: add documentation for eBPF helpers (58-64)

2018-04-25 Thread Quentin Monnet
sper Dangaard Brouer Cc: John Fastabend Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 147 +++ 1 file changed, 147 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 9fe008dd51e7..335ac427d43b 100644 ---

[PATCH bpf-next v4 09/10] bpf: add documentation for eBPF helpers (65-66)

2018-04-25 Thread Quentin Monnet
versions). Cc: Nikita V. Shirokov Cc: Eyal Birger Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 30 ++ 1 file changed, 30 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 335ac427d43b..3b91e22f68c1 100644 --- a

[PATCH bpf-next v4 06/10] bpf: add documentation for eBPF helpers (42-50)

2018-04-25 Thread Quentin Monnet
Martin KaFai Lau Cc: Sargun Dhillon Cc: Thomas Graf Cc: Gianluca Borello Cc: Chenbo Feng Signed-off-by: Quentin Monnet Acked-by: Alexei Starovoitov Acked-by: Martin KaFai Lau [for bpf_skb_under_cgroup(), bpf_xdp_adjust_head()] --- include/uapi/linux/bpf.h | 172 ++

[PATCH bpf-next v4 05/10] bpf: add documentation for eBPF helpers (33-41)

2018-04-25 Thread Quentin Monnet
e that the helper is not restricted to programs attached to sockets. - bpf_skb_adjust_room(): Clarify comment about invalidated verifier checks. - bpf_xdp_adjust_meta(): Clarify comment about invalidated verifier checks. Cc: Daniel Borkmann Signed-off-by: Quentin Monnet Acked-by

[PATCH bpf-next v4 10/10] bpf: update bpf.h uapi header for tools

2018-04-25 Thread Quentin Monnet
Update tools/include/uapi/linux/bpf.h file in order to reflect the changes for BPF helper functions documentation introduced in previous commits. Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 1776 +++- 1 file changed, 1380 insertions

[PATCH bpf-next v4 07/10] bpf: add documentation for eBPF helpers (51-57)

2018-04-25 Thread Quentin Monnet
description. Remove occurences of "cores" to avoid confusion with "CPU". - bpf_bind(): Remove last paragraph of description, which was off topic. Cc: Lawrence Brakmo Cc: Yonghong Song Cc: Josef Bacik Cc: Andrey Ignatov Signed-off-by: Quentin Monnet Acked-by:

[PATCH bpf-next v4 02/10] bpf: add documentation for eBPF helpers (01-11)

2018-04-25 Thread Quentin Monnet
e description of BPF_F_INGRESS flag. Cc: Alexei Starovoitov Signed-off-by: Quentin Monnet Acked-by: Alexei Starovoitov --- include/uapi/linux/bpf.h | 230 +++ 1 file changed, 230 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/

[PATCH bpf-next v4 03/10] bpf: add documentation for eBPF helpers (12-22)

2018-04-25 Thread Quentin Monnet
t_stackid(): Add a note about PERF_MAX_STACK_DEPTH being configurable. Cc: Alexei Starovoitov Signed-off-by: Quentin Monnet Acked-by: Alexei Starovoitov --- include/uapi/linux/bpf.h | 254 +++ 1 file changed, 254 insertions(+) diff --git a/include

Re: [PATCH 2/2] bpftool: Adjust to new print_bpf_insn interface

2018-03-21 Thread Quentin Monnet
2018-03-21 16:02 UTC+0100 ~ Jiri Olsa > Change bpftool to skip the removed struct bpf_verifier_env > argument in print_bpf_insn. It was passed as NULL anyway. > > No functional change intended. > > Signed-off-by: Jiri Olsa > --- > tools/bpf/bpftool/prog.c | 8 > 1 file changed, 4 inse

Re: [PATCH 1/2] bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

2018-03-21 Thread Quentin Monnet
2018-03-21 16:02 UTC+0100 ~ Jiri Olsa > We use print_bpf_insn in user space (bpftool and soon perf), > so it'd be nice to keep it generic and strip it off the kernel > struct bpf_verifier_env argument. > > This argument can be safely removed, because its users can > use the struct bpf_insn_cbs::p

Re: [PATCHv2 2/2] bpftool: Adjust to new print_bpf_insn interface

2018-03-21 Thread Quentin Monnet
> jirka > > > --- > Change bpftool to skip the removed struct bpf_verifier_env > argument in print_bpf_insn. It was passed as NULL anyway. > > No functional change intended. > > Signed-off-by: Jiri Olsa > --- > tools/bpf/bpftool/xlated_dumper.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > Thank you! Reviewed-by: Quentin Monnet

Re: [PATCH 1/2] bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

2018-03-22 Thread Quentin Monnet
2018-03-22 14:32 UTC+0100 ~ Jiri Olsa > On Thu, Mar 22, 2018 at 10:34:18AM +0100, Daniel Borkmann wrote: >> On 03/21/2018 07:37 PM, Jiri Olsa wrote: >>> On Wed, Mar 21, 2018 at 05:25:33PM +0000, Quentin Monnet wrote: >>>> 2018-03-21 16:02 UTC+0100 ~ Jiri Olsa >&

Re: [PATCH 0/2] bpf: Change print_bpf_insn interface

2018-03-23 Thread Quentin Monnet
ubmitting new versions of your patch sets :) For the series: Reviewed-by: Quentin Monnet

[PATCH bpf-next] tools: bpftool: add "prog run" subcommand to test-run programs

2019-07-04 Thread Quentin Monnet
260ns When one of data_in or ctx_in is "-", bpftool reads from standard input, in binary format. Other formats (JSON, hexdump) might be supported (via an optional command line keyword like "data_fmt_in") in the future if relevant, but this would require doing more parsing in

Re: [PATCH] tools bpftool: Fix json dump crash on powerpc

2019-07-04 Thread Quentin Monnet
at, which is not always > true at least for powerpc. Fixing this by dumping the whole string > into buffer based on its format. > > Please note that libopcodes code does not check return values from > fprintf callback, so there's no point to return error in case of > allocation failure. > > Reported-by: Michael Petlan > Signed-off-by: Jiri Olsa Looks good to me, thank you for the fix! Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next] tools: bpftool: add "prog run" subcommand to test-run programs

2019-07-05 Thread Quentin Monnet
2019-07-04 22:49 UTC-0700 ~ Y Song > On Thu, Jul 4, 2019 at 1:58 AM Quentin Monnet > wrote: >> >> Add a new "bpftool prog run" subcommand to run a loaded program on input >> data (and possibly with input context) passed by the user. >> >> Print outpu

Re: [PATCH bpf-next] tools: bpftool: add "prog run" subcommand to test-run programs

2019-07-05 Thread Quentin Monnet
2019-07-05 08:42 UTC-0700 ~ Y Song > On Fri, Jul 5, 2019 at 1:21 AM Quentin Monnet > wrote: >> >> 2019-07-04 22:49 UTC-0700 ~ Y Song >>> On Thu, Jul 4, 2019 at 1:58 AM Quentin Monnet >>> wrote: >>>> >>>> Add a new "bpftool pro

Re: [PATCHv2] tools bpftool: Fix json dump crash on powerpc

2019-07-05 Thread Quentin Monnet
lease note that libopcodes code does not check return values from >> fprintf callback, but as per Jakub suggestion returning -1 on allocation >> failure so we do the best effort to propagate the error. >> >> Reported-by: Michael Petlan >> Signed-off-by: Jiri Olsa > > Thanks, let me repost all the tags (Quentin, please shout if you're > not ok with this :)): I confirm it's all good for me, thanks :) > > Fixes: 107f041212c1 ("tools: bpftool: add JSON output for `bpftool prog dump > jited *` command") > Reviewed-by: Quentin Monnet > Reviewed-by: Jakub Kicinski >

Re: [PATCH bpf-next] tools: bpftool: add "prog run" subcommand to test-run programs

2019-07-05 Thread Quentin Monnet
2019-07-05 10:08 UTC-0700 ~ Y Song > On Fri, Jul 5, 2019 at 9:03 AM Quentin Monnet > wrote: >> >> 2019-07-05 08:42 UTC-0700 ~ Y Song >>> On Fri, Jul 5, 2019 at 1:21 AM Quentin Monnet >>> wrote: >>>> >>>> 2019-07-04 22:49 UTC-0700 ~

[PATCH bpf-next v2] tools: bpftool: add "prog run" subcommand to test-run programs

2019-07-05 Thread Quentin Monnet
e parsing in bpftool. v2: - Fix argument names for function check_single_stdin(). (Yonghong) Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- .../bpftool/Documentation/bpftool-prog.rst| 34 ++ tools/bpf/bpftool/bash-completion/bpftool | 28 +- tools/bpf/bpftool/ma

Re: [PATCH bpf-next v2 6/6] tools: Add definitions for devmap_hash map type

2019-07-08 Thread Quentin Monnet
2019-07-06 10:47 UTC+0200 ~ Toke Høiland-Jørgensen > From: Toke Høiland-Jørgensen > > This adds a selftest, syncs the tools/ uapi header and adds the > devmap_hash name to bpftool for the new devmap_hash map type. > > Signed-off-by: Toke Høiland-Jørgensen > --- > tools/bpf/bpftool/map.c

[PATCH bpf-next] tools: bpftool: add completion for bpftool prog "loadall"

2019-07-08 Thread Quentin Monnet
considers that $command is in load|loadall and starts making related completions (file or directory names, as the number of words on the command line is below 6), when the only suggested keywords should be "load" and "loadall" until one has been picked and a space entered after

Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-14 Thread Quentin Monnet
2019-08-13 18:51 UTC-0700 ~ Alexei Starovoitov > On Tue, Aug 13, 2019 at 02:09:18PM +0100, Quentin Monnet wrote: >> This series adds a "bpftool map count" subcommand to count the number of >> entries present in a BPF map. This results from a customer request for a >&

[PATCH bpf-next] tools: bpftool: compile with $(EXTRA_WARNINGS)

2019-08-14 Thread Quentin Monnet
warnings we manually add to CFLAGS, as it is handled in $(EXTRA_WARNINGS). Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Makefile | 3 ++- tools/bpf/bpftool/cgroup.c | 2 +- tools/bpf/bpftool/perf.c | 4 3 files changed, 7 insertions(+), 2 deletions

Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-14 Thread Quentin Monnet
2019-08-14 17:45 UTC+0100 ~ Edward Cree > On 14/08/2019 10:42, Quentin Monnet wrote: >> 2019-08-13 18:51 UTC-0700 ~ Alexei Starovoitov >> >>> The same can be achieved by 'bpftool map dump|grep key|wc -l', no? >> To some extent (with subtleties for some o

Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-14 Thread Quentin Monnet
2019-08-14 09:58 UTC-0700 ~ Alexei Starovoitov > On Wed, Aug 14, 2019 at 9:45 AM Edward Cree wrote: >> >> On 14/08/2019 10:42, Quentin Monnet wrote: >>> 2019-08-13 18:51 UTC-0700 ~ Alexei Starovoitov >>> >>>> The same can be achieved by 'bpftoo

Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-15 Thread Quentin Monnet
2019-08-14 13:18 UTC-0700 ~ Andrii Nakryiko > On Wed, Aug 14, 2019 at 10:12 AM Quentin Monnet > wrote: >> >> 2019-08-14 09:58 UTC-0700 ~ Alexei Starovoitov >> >>> On Wed, Aug 14, 2019 at 9:45 AM Edward Cree wrote: >>>> >>>> On 14/08/201

Re: [RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-15 Thread Quentin Monnet
2019-08-14 18:14 UTC+0100 ~ Edward Cree > On 14/08/2019 17:58, Quentin Monnet wrote: >> 2019-08-14 17:45 UTC+0100 ~ Edward Cree >>> This might be a really dumb suggestion, but: you're wanting to collect a >>>  summary statistic over an in-kernel data structure i

[PATCH bpf] tools: bpftool: close prog FD before exit on showing a single program

2019-08-15 Thread Quentin Monnet
When showing metadata about a single program by invoking "bpftool prog show PROG", the file descriptor referring to the program is not closed before returning from the function. Let's close it. Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Quentin M

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

2019-08-15 Thread Quentin Monnet
then moves the "__printf()" attributes to header files, so that the checks are performed at all locations. Quentin Monnet (6): tools: bpftool: fix arguments for p_err() in do_event_pipe() tools: bpftool: fix format strings and arguments for jsonw_printf() tools: bpftool: fix argumen

[PATCH bpf 3/6] tools: bpftool: fix argument for p_err() in BTF do_dump()

2019-08-15 Thread Quentin Monnet
dump BTF types") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 1b8ec91899e6..8805637f1a7e 100644 --- a/tools/bpf/bpftool/btf.c +++

[PATCH bpf 6/6] tools: bpftool: move "__printf()" attributes to header file

2019-08-15 Thread Quentin Monnet
CC_VERSION from headers pulled via libbfd. Fixes: c101189bc968 ("tools: bpftool: fix -Wmissing declaration warnings") Reported-by: Jakub Kicinski Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/common.c | 4 ++-- tools/bpf/bpftool/json_writer.c| 6

  1   2   3   4   5   6   >