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

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 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 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-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] 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 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

[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: 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

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: >> >

[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: [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 bpf v1] tools/bpftool: support passing BPFTOOL_VERSION to make

2020-09-17 Thread Quentin Monnet
arget in the top-level makefile, which would otherwise pull in several > other includes from outside the tools tree. > > Signed-off-by: Tony Ambardar Acked-by: Quentin Monnet

Re: [PATCH bpf-next] bpftool: fix build failure

2020-09-14 Thread Quentin Monnet
On 14/09/2020 17:54, Yonghong Song wrote: > > > On 9/14/20 9:46 AM, Yonghong Song wrote: >> >> >> On 9/14/20 1:16 AM, Quentin Monnet wrote: >>> On 14/09/2020 07:12, Yonghong Song wrote: >>>> When building bpf selftests like >>>>

Re: [PATCH bpf-next] bpftool: fix build failure

2020-09-14 Thread Quentin Monnet
using: > -bash-4.4$ rst2man --version > rst2man (Docutils 0.11 [repository], Python 2.7.5, on linux2) > -bash-4.4$ > > Looks like that particular version of rst2man prefers to have a blank line > after literal blocks. This patch added block lines in related .rst files > and

[PATCH bpf-next v4] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-10 Thread Quentin Monnet
all other pages are available in the same directory. v3: - Fix conflict with a previous patchset that introduced RST2MAN_OPTS variable passed to rst2man. v2: - Use "echo -n" instead of "printf" in Makefile, to avoid any risk of passing a format string directly to the command

Re: [PATCH bpf-next v3 3/3] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-10 Thread Quentin Monnet
On Thu, 10 Sep 2020 at 19:18, Alexei Starovoitov wrote: > > On Wed, Sep 9, 2020 at 9:25 AM Quentin Monnet wrote: > > > > The "SEE ALSO" sections of bpftool's manual pages refer to bpf(2), > > bpf-helpers(7), then all existing bpftool man pages (save the

Re: [PATCH bpf-next v3 2/3] tools: bpftool: keep errors for map-of-map dumps if distinct from ENOENT

2020-09-10 Thread Quentin Monnet
On 10/09/2020 17:42, Andrii Nakryiko wrote: > On Thu, Sep 10, 2020 at 3:27 AM Quentin Monnet wrote: >> >> When dumping outer maps or prog_array maps, and on lookup failure, >> bpftool simply skips the entry with no error message. This is because >> the kernel return

[PATCH bpf-next v3 1/3] tools: bpftool: clean up function to dump map entry

2020-09-10 Thread Quentin Monnet
. No functional change. v2: - v1 was erroneously removing the check on fd maps in an attempt to get support for outer map dumps. This is already working. Instead, v2 focuses on cleaning up the dump_map_elem() function, to avoid similar confusion in the future. Signed-off-by: Quentin Monnet

[PATCH bpf-next v3 2/3] tools: bpftool: keep errors for map-of-map dumps if distinct from ENOENT

2020-09-10 Thread Quentin Monnet
occurs, errno is set to ENOENT. It seems unlikely we could receive other error codes at this stage (we successfully retrieved map info just before), but to be on the safe side, let's skip the entry only if errno was ENOENT, and not for the other errors. v3: New patch Signed-off-by: Quentin M

[PATCH bpf-next v3 0/2] tools: bpftool: support creating outer maps

2020-09-10 Thread Quentin Monnet
check on errno being ENOENT before skipping outer map entry in dumps. v2: - v1 was wrongly expected to allow bpftool to dump the content of outer maps (already supported). v2 skipped that patch, and instead replaced it with a clean-up for the dump_map_elem() function. Quentin Monnet (3

[PATCH bpf-next v3 3/3] tools: bpftool: add "inner_map" to "bpftool map create" outer maps

2020-09-10 Thread Quentin Monnet
ame my_inner_map [TAB] Fixing that specific case seems too convoluted. Completion will work as expected, however, if the outer map name comes first and the "inner_map name ..." is passed second. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko --- .../bpf/bpftool/Documentat

Re: [PATCH bpf-next v2 1/2] tools: bpftool: clean up function to dump map entry

2020-09-09 Thread Quentin Monnet
On 09/09/2020 17:46, Andrii Nakryiko wrote: > On Wed, Sep 9, 2020 at 9:38 AM Quentin Monnet wrote: >> >> On 09/09/2020 17:30, Andrii Nakryiko wrote: >>> On Wed, Sep 9, 2020 at 1:19 AM Quentin Monnet wrote: >>>> >>>> On 09/09/2020 04:25, Andrii Nakr

Re: [PATCH bpf-next v2 2/2] selftests, bpftool: add bpftool (and eBPF helpers) documentation build

2020-09-09 Thread Quentin Monnet
On 09/09/2020 17:45, Andrii Nakryiko wrote: > On Wed, Sep 9, 2020 at 9:22 AM Quentin Monnet wrote: >> >> eBPF selftests include a script to check that bpftool builds correctly >> with different command lines. Let's add one build for bpftool's >> documentat

[PATCH bpf-next v3 0/3] tools: bpftool: print built-in features, automate some of the documentation

2020-09-09 Thread Quentin Monnet
k of passing and evaluating formatting strings. Quentin Monnet (3): tools: bpftool: print optional built-in features along with version tools: bpftool: include common options from separate file tools: bpftool: automate generation for "SEE ALSO" sections in man pages

[PATCH bpf-next v3 1/3] tools: bpftool: print optional built-in features along with version

2020-09-09 Thread Quentin Monnet
d on the version number, and are therefore not reported either. Note that they are already available, albeit without JSON, via bpftool's help messages. v3: - Use a simple list instead of boolean values for plain output. v2: - Fix JSON (object instead or array for the features). Signed

Re: [PATCH bpf-next v2 1/2] tools: bpftool: clean up function to dump map entry

2020-09-09 Thread Quentin Monnet
On 09/09/2020 17:30, Andrii Nakryiko wrote: > On Wed, Sep 9, 2020 at 1:19 AM Quentin Monnet wrote: >> >> On 09/09/2020 04:25, Andrii Nakryiko wrote: >>> On Mon, Sep 7, 2020 at 9:36 AM Quentin Monnet wrote: >>>> >>>> The function used to d

[PATCH bpf-next v3 3/3] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-09 Thread Quentin Monnet
all other pages are available in the same directory. v2: - Use "echo -n" instead of "printf" in Makefile, to avoid any risk of passing a format string directly to the command. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko --- tools/bpf/bpftool/Documentation/Ma

[PATCH bpf-next v3 2/3] tools: bpftool: include common options from separate file

2020-09-09 Thread Quentin Monnet
options are not "common" and should not be copied when creating new manual pages. Let's move the description for those common options to a separate file, which is included with a RST directive when generating the man pages. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko

[PATCH bpf-next v2 0/2] bpf: detect build errors for man pages for bpftool and eBPF helpers

2020-09-09 Thread Quentin Monnet
tests. Quentin Monnet (2): tools: bpftool: log info-level messages when building bpftool man pages selftests, bpftool: add bpftool (and eBPF helpers) documentation build tools/bpf/bpftool/Documentation/Makefile | 3 ++- .../bpf/bpftool/Documentation/bpftool-btf.rst | 3 +++ .../bpf/bp

[PATCH bpf-next v2 2/2] selftests, bpftool: add bpftool (and eBPF helpers) documentation build

2020-09-09 Thread Quentin Monnet
ils"). v2: - Use "--exit-status=1" option for rst2man instead of counting lines from stderr. - Also build bpftool as part as the selftests build (and not only when the tests are actually run). Signed-off-by: Quentin Monnet --- tools/testing/selftests/bpf/Makefil

[PATCH bpf-next v2 1/2] tools: bpftool: log info-level messages when building bpftool man pages

2020-09-09 Thread Quentin Monnet
Let's add the necessary blank lines. v2: - Use "--verbose" instead of "-r 1" (same behaviour but more readable). - Pass it through a RST2MAN_OPTS variable so we can easily pass other options too. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko --- tools/bpf/

Re: [PATCH bpf-next 1/3] tools: bpftool: print optional built-in features along with version

2020-09-09 Thread Quentin Monnet
On 09/09/2020 00:20, Andrii Nakryiko wrote: > On Mon, Sep 7, 2020 at 7:50 AM Quentin Monnet wrote: >> >> On 04/09/2020 22:45, Andrii Nakryiko wrote: >>> On Fri, Sep 4, 2020 at 1:57 PM Quentin Monnet wrote: >>>> >>>> Bpftool has a number of feature

Re: [PATCH bpf-next v2 1/2] tools: bpftool: clean up function to dump map entry

2020-09-09 Thread Quentin Monnet
On 09/09/2020 04:25, Andrii Nakryiko wrote: > On Mon, Sep 7, 2020 at 9:36 AM Quentin Monnet wrote: >> >> The function used to dump a map entry in bpftool is a bit difficult to >> follow, as a consequence to earlier refactorings. There is a variable >> ("num_ele

Re: [PATCH bpf-next 0/2] bpf: detect build errors for man pages for bpftool and eBPF helpers

2020-09-09 Thread Quentin Monnet
On 09/09/2020 04:48, Andrii Nakryiko wrote: > On Mon, Sep 7, 2020 at 9:40 AM Quentin Monnet wrote: >> >> This set aims at improving the checks for building bpftool's documentation >> (including the man page for eBPF helper functions). The first patch lowers >> th

[PATCH bpf-next v2 2/3] tools: bpftool: include common options from separate file

2020-09-07 Thread Quentin Monnet
options are not "common" and should not be copied when creating new manual pages. Let's move the description for those common options to a separate file, which is included with a RST directive when generating the man pages. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko

[PATCH bpf-next v2 1/2] tools: bpftool: clean up function to dump map entry

2020-09-07 Thread Quentin Monnet
. No functional change. v2: - v1 was erroneously removing the check on fd maps in an attempt to get support for outer map dumps. This is already working. Instead, v2 focuses on cleaning up the dump_map_elem() function, to avoid similar confusion in the future. Signed-off-by: Quentin Monnet

[PATCH bpf-next v2 1/3] tools: bpftool: print optional built-in features along with version

2020-09-07 Thread Quentin Monnet
y are already available, albeit without JSON, via bpftool's help messages. v2: - Fix JSON (object instead or array for the features). Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/bpftool.rst | 8 ++- tools/bpf/bpftool/main.c| 26 +

[PATCH bpf-next 1/2] tools: bpftool: log info-level messages when building bpftool man pages

2020-09-07 Thread Quentin Monnet
Let's add the necessary blank lines. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/Makefile| 2 +- tools/bpf/bpftool/Documentation/bpftool-btf.rst | 3 +++ tools/bpf/bpftool/Documentation/bpftool-gen.rst | 4 tools/bpf/bpftool/Documentation/bpftool-map.rst

[PATCH bpf-next 2/2] selftests, bpftool: add bpftool (and eBPF helpers) documentation build

2020-09-07 Thread Quentin Monnet
e for eBPF helpers, which is built along bpftool's documentation. Signed-off-by: Quentin Monnet --- .../selftests/bpf/test_bpftool_build.sh | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/selftests/bpf/test_bpftool_build.sh b/tools/testin

[PATCH bpf-next 0/2] bpf: detect build errors for man pages for bpftool and eBPF helpers

2020-09-07 Thread Quentin Monnet
eBPF selftests, so that we also check a documentation build. This is after a suggestion from Andrii Nakryiko. Quentin Monnet (2): tools: bpftool: log info-level messages when building bpftool man pages selftests, bpftool: add bpftool (and eBPF helpers) documentation build tools/bpf/bp

[PATCH bpf-next v2 0/3] tools: bpftool: print built-in features, automate some of the documentation

2020-09-07 Thread Quentin Monnet
o reduce the risk of omissions when adding the documentation for new commands. v2: - Fix incorrect JSON output. - Use "echo -n" instead of "printf" in Makefile to avoid the risk of passing and evaluating formatting strings. Quentin Monnet (3): tools: bpftool: print optional buil

[PATCH bpf-next v2 3/3] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-07 Thread Quentin Monnet
all other pages are available in the same directory. v2: - Use "echo -n" instead of "printf" in Makefile, to avoid any risk of passing a format string directly to the command. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko --- tools/bpf/bpftool/Documentation/Ma

[PATCH bpf-next v2 2/2] tools: bpftool: add "inner_map" to "bpftool map create" outer maps

2020-09-07 Thread Quentin Monnet
ame my_inner_map [TAB] Fixing that specific case seems too convoluted. Completion will work as expected, however, if the outer map name comes first and the "inner_map name ..." is passed second. Signed-off-by: Quentin Monnet Acked-by: Andrii Nakryiko --- .../bpf/bpftool/Documentat

[PATCH bpf-next v2 0/2] tools: bpftool: support creating outer maps

2020-09-07 Thread Quentin Monnet
expected to allow bpftool to dump the content of outer maps (already supported). v2 skipped that patch, and instead replaced it with a clean-up for the dump_map_elem() function. Quentin Monnet (2): tools: bpftool: clean up function to dump map entry tools: bpftool: add "inner_ma

Re: [PATCH bpf-next 0/3] bpf: format fixes for BPF helpers and bpftool documentation

2020-09-07 Thread Quentin Monnet
On 04/09/2020 22:40, Andrii Nakryiko wrote: > On Fri, Sep 4, 2020 at 9:15 AM Quentin Monnet wrote: >> >> This series contains minor fixes (or harmonisation edits) for the >> bpftool-link documentation (first patch) and BPF helpers documentation >> (last two patches), so

Re: [PATCH bpf-next 1/2] tools: bpftool: dump outer maps content

2020-09-07 Thread Quentin Monnet
On 04/09/2020 23:03, Andrii Nakryiko wrote: > On Fri, Sep 4, 2020 at 9:14 AM Quentin Monnet wrote: >> >> Although user space can lookup and dump the content of an outer map >> (hash-of-maps or array-of-maps), bpftool does not allow to do so. >> >> It seems

Re: [PATCH bpf-next 1/3] tools: bpftool: print optional built-in features along with version

2020-09-07 Thread Quentin Monnet
On 04/09/2020 22:45, Andrii Nakryiko wrote: > On Fri, Sep 4, 2020 at 1:57 PM Quentin Monnet wrote: >> >> Bpftool has a number of features that can be included or left aside >> during compilation. This includes: >> >> - Support for libbfd, providing the disassembl

Re: [PATCH bpf-next 3/3] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-07 Thread Quentin Monnet
On 04/09/2020 22:51, Andrii Nakryiko wrote: > On Fri, Sep 4, 2020 at 1:58 PM Quentin Monnet wrote: >> >> The "SEE ALSO" sections of bpftool's manual pages refer to bpf(2), >> bpf-helpers(7), then all existing bpftool man pages (save the current >> one).

[PATCH bpf-next 2/3] tools: bpftool: include common options from separate file

2020-09-04 Thread Quentin Monnet
options are not "common" and should not be copied when creating new manual pages. Let's move the description for those common options to a separate file, which is included with a RST directive when generating the man pages. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documen

[PATCH bpf-next 1/3] tools: bpftool: print optional built-in features along with version

2020-09-04 Thread Quentin Monnet
ey are already available, albeit without JSON, via bpftool's help messages. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/bpftool.rst | 8 +++- tools/bpf/bpftool/main.c| 22 + 2 files changed, 29 insertions(+), 1 deletion(

[PATCH bpf-next 3/3] tools: bpftool: automate generation for "SEE ALSO" sections in man pages

2020-09-04 Thread Quentin Monnet
all other pages are available in the same directory. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/Makefile| 12 +++- tools/bpf/bpftool/Documentation/bpftool-btf.rst | 17 - .../bpftool/Documentation/bpftool-cgroup.rst| 16 -

[PATCH bpf-next 0/3] tools: bpftool: print built-in features, automate some of the documentation

2020-09-04 Thread Quentin Monnet
o reduce the risk of omissions when adding the documentation for new commands. Quentin Monnet (3): tools: bpftool: print optional built-in features along with version tools: bpftool: include common options from separate file tools: bpftool: automate generation for "SEE ALSO" sections in man

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

2020-09-04 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the fixes recently brought to the documentation for the BPF helpers. Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 87 ++ 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a

[PATCH bpf-next 0/3] bpf: format fixes for BPF helpers and bpftool documentation

2020-09-04 Thread Quentin Monnet
This series contains minor fixes (or harmonisation edits) for the bpftool-link documentation (first patch) and BPF helpers documentation (last two patches), so that all related man pages can build without errors. Quentin Monnet (3): tools: bpftool: fix formatting in bpftool-link documentation

[PATCH bpf-next 2/3] bpf: fix formatting in documentation for BPF helpers

2020-09-04 Thread Quentin Monnet
Fix a formatting error in the description of bpf_load_hdr_opt() (rst2man complains about a wrong indentation, but what is missing is actually a blank line before the bullet list). Fix and harmonise the formatting for other helpers. Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h

[PATCH bpf-next 1/3] tools: bpftool: fix formatting in bpftool-link documentation

2020-09-04 Thread Quentin Monnet
Fix a formatting error in the documentation for bpftool-link, so that the man page can build correctly. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/Documentation/bpftool-link.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool

[PATCH bpf-next 2/2] tools: bpftool: add "inner_map" to "bpftool map create" outer maps

2020-09-04 Thread Quentin Monnet
ame my_inner_map [TAB] Fixing that specific case seems too convoluted. Completion will work as expected, however, if the outer map name comes first and the "inner_map name ..." is passed second. Signed-off-by: Quentin Monnet --- .../bpf/bpftool/Documentation/bpftool-map.rst | 10 +++- t

[PATCH bpf-next 0/2] tools: bpftool: support creating and dumping outer maps

2020-09-04 Thread Quentin Monnet
evant inner_map_fd, which we do through a new command-line keyword. Quentin Monnet (2): tools: bpftool: dump outer maps content tools: bpftool: add "inner_map" to "bpftool map create" outer maps .../bpf/bpftool/Documentation/bpftool-map.rst | 10 +++- tools/bpf/bpftool/bash-co

[PATCH bpf-next 1/2] tools: bpftool: dump outer maps content

2020-09-04 Thread Quentin Monnet
tis Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/map.c | 4 1 file changed, 4 deletions(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index bc0071228f88..cb3a75eb5531 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -739,10 +739,6 @@ static in

[PATCH bpf-next 1/2] tools: bpftool: skip type probe if name is not found

2020-07-24 Thread Quentin Monnet
it by skipping probes for "unknown" program and map types, with an informational message giving the numeral value in that case. Fixes: 93a3545d812a ("tools/bpftool: Add name mappings for SK_LOOKUP prog and attach type") Reported-by: Paul Chaignon Signed-off-by: Quentin Monnet -

[PATCH bpf-next 2/2] tools: bpftool: add LSM type to array of prog names

2020-07-24 Thread Quentin Monnet
Assign "lsm" as a printed name for BPF_PROG_TYPE_LSM in bpftool, so that it can use it when listing programs loaded on the system or when probing features. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bpf/bpftoo

[PATCH bpf-next 0/2] tools: bpftool: update prog names list and fix segfault

2020-07-24 Thread Quentin Monnet
ich skipped the "lsm" in the list. Let's update the list, and let's make sure it does not crash bpftool again if we omit other types again in the future. Quentin Monnet (2): tools: bpftool: skip type probe if name is not found tools: bpftool: add LSM type to array of prog

Re: [PATCH bpf-next] tools/bpftool: strip BPF .o files before skeleton generation

2020-07-22 Thread Quentin Monnet
On 22/07/2020 05:38, Andrii Nakryiko wrote: > Strip away DWARF info from .bpf.o files, before generating BPF skeletons. > This reduces bpftool binary size from 3.43MB to 2.58MB. > > Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet

Re: [PATCH bpf-next v4] bpftool: use only nftw for file tree parsing

2020-07-21 Thread Quentin Monnet
ar All good for me this time, thank you! Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next v3] bpftool: use only nftw for file tree parsing

2020-07-20 Thread Quentin Monnet
On 17/07/2020 23:55, Tony Ambardar wrote: > The bpftool sources include code to walk file trees, but use multiple > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > is widely available, fts is not conformant and less common, especially on > non-glibc systems. The inconsis

Re: [PATCH bpf-next 09/13] tools/bpftool: add bpftool support for bpf map element iterator

2020-07-17 Thread Quentin Monnet
2020-07-16 10:42 UTC-0700 ~ Yonghong Song > > > On 7/16/20 9:39 AM, Quentin Monnet wrote: >> 2020-07-13 09:17 UTC-0700 ~ Yonghong Song [...] >> Could you please also update the bash completion? > > This is always my hardest part! In this case it is >   bpftool

Re: [PATCH bpf-next 09/13] tools/bpftool: add bpftool support for bpf map element iterator

2020-07-16 Thread Quentin Monnet
2020-07-13 09:17 UTC-0700 ~ Yonghong Song > The optional parameter "map MAP" can be added to "bpftool iter" > command to create a bpf iterator for map elements. For example, > bpftool iter pin ./prog.o /sys/fs/bpf/p1 map id 333 > > For map element bpf iterator "map MAP" parameter is required. >

Re: [PATCH bpf-next v2] bpftool: use only nftw for file tree parsing

2020-07-16 Thread Quentin Monnet
2020-07-15 22:29 UTC-0700 ~ Tony Ambardar > The bpftool sources include code to walk file trees, but use multiple > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > is widely available, fts is not conformant and less common, especially on > non-glibc systems. The inconsi

Re: [PATCH bpf-next] bpftool: use only nftw for file tree parsing

2020-07-15 Thread Quentin Monnet
2020-07-14 22:12 UTC-0700 ~ Tony Ambardar > The bpftool sources include code to walk file trees, but use multiple > frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and > is widely available, fts is not conformant and less common, especially on > non-glibc systems. The inconsi

Re: [PATCH] tools/bpftool: Fix error return code in do_skeleton()

2020-07-15 Thread Quentin Monnet
2020-07-15 11:13 UTC+0800 ~ YueHaibing > The error return code should be PTR_ERR(obj) other than > PTR_ERR(NULL). > > Fixes: 5dc7a8b21144 ("bpftool, selftests/bpf: Embed object file inside > skeleton") > Signed-off-by: YueHaibing Reviewed-by: Quentin Monnet Thanks!

Re: [PATCH bpf-next] bpf: Fix another bpftool segfault without skeleton code enabled

2020-07-08 Thread Quentin Monnet
3, > "bytes_memlock": 4096, > "map_ids": [2,3 > Segmentation fault (core dumped) > > The same happens for ./bpftool -p map, as well as ./bpftool -j prog/map. > > Fixes: d53dee3fe013 ("tools/bpftool: Show info for processes holding BPF > map/prog/link/btf FDs") > Signed-off-by: Louis Peens > Reviewed-by: Simon Horman Reviewed-by: Quentin Monnet Thanks Louis.

Re: [PATCH bpf] bpf: fix formatting in documentation for BPF helpers

2020-06-24 Thread Quentin Monnet
2020-06-23 18:02 UTC-0700 ~ Alexei Starovoitov > On Tue, Jun 23, 2020 at 8:39 AM Quentin Monnet wrote: >> >> When producing the bpf-helpers.7 man page from the documentation from >> the BPF user space header file, rst2man complains: >> >> :2636: (ERROR/3) Une

[PATCH bpf-next v2] tools: bpftool: fix variable shadowing in emit_obj_refs_json()

2020-06-23 Thread Quentin Monnet
x27;s rename the variable. v2: - Rename the variable instead of calling the global json_wtr directly. Signed-off-by: Quentin Monnet --- v1 was "tools: bpftool: do not pass json_wtr to emit_obj_refs_json()" --- tools/bpf/bpftool/pids.c | 17 + 1 file changed, 9 insertio

Re: [PATCH bpf-next] tools: bpftool: do not pass json_wtr to emit_obj_refs_json()

2020-06-23 Thread Quentin Monnet
On Tue, 23 Jun 2020 at 19:27, Andrii Nakryiko wrote: > > On Tue, Jun 23, 2020 at 8:54 AM Quentin Monnet wrote: > > > > Building bpftool yields the following complaint: > > > > pids.c: In function ‘emit_obj_refs_json’: > > pids.c:175:80: warning: declar

[PATCH bpf-next] tools: bpftool: do not pass json_wtr to emit_obj_refs_json()

2020-06-23 Thread Quentin Monnet
main.h (included in pids.c) as an extern, it is directly available and there is no need to pass it through the function. Let's simply use the global variable. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/btf.c | 2 +- tools/bpf/bpftool/link.c | 2 +- tools/bpf/bpftool/main.

[PATCH bpf] bpf: fix formatting in documentation for BPF helpers

2020-06-23 Thread Quentin Monnet
chunk (item list in bpf_ringbuf_query()'s description), and for a couple other functions. Signed-off-by: Quentin Monnet --- include/uapi/linux/bpf.h | 41 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/

Re: [PATCH v3 bpf-next 9/9] tools/bpftool: add documentation and sample output for process info

2020-06-19 Thread Quentin Monnet
2020-06-19 16:17 UTC-0700 ~ Andrii Nakryiko > Add statements about bpftool being able to discover process info, holding > reference to BPF map, prog, link, or BTF. Show example output as well. > > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Thanks!

Re: [PATCH v3 bpf-next 8/9] tools/bpftool: show info for processes holding BPF map/prog/link/btf FDs

2020-06-19 Thread Quentin Monnet
; 62: cgroup prog 2908 > cgroup_id 375344 attach_type egress > pids test_progs(2238417), test_progs(2238445) > > $ sudo ./bpftool btf show > 1202: size 1527B prog_ids 2908,2907 map_ids 2436 > pids test_progs(2238417), test_progs(2238445) > 1242: size 34684B > pids bpftool(2258892) > > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next 8/9] tools/bpftool: show info for processes holding BPF map/prog/link/btf FDs

2020-06-18 Thread Quentin Monnet
2020-06-17 23:01 UTC-0700 ~ Andrii Nakryiko > On Wed, Jun 17, 2020 at 5:24 PM Quentin Monnet wrote: >> >> 2020-06-17 09:18 UTC-0700 ~ Andrii Nakryiko >>> Add bpf_iter-based way to find all the processes that hold open FDs against >>> BPF object (map, prog, link,

Re: [PATCH bpf-next 5/9] tools/bpftool: minimize bootstrap bpftool

2020-06-17 Thread Quentin Monnet
ed to care about bootstrap mode for those new parts of bpftool. > > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next 4/9] tools/bpftool: move map/prog parsing logic into common

2020-06-17 Thread Quentin Monnet
re decoupled from the rest of bpftool files and facilitates more > lightweight bootstrap bpftool variant. > > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next 6/9] tools/bpftool: generalize BPF skeleton support and generate vmlinux.h

2020-06-17 Thread Quentin Monnet
> check for support of preserve_access_index attribute, which, together with BTF > for global variables, is the minimum requirement for modern BPF programs. > > Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet

Re: [PATCH bpf-next 9/9] tools/bpftool: add documentation and sample output for process info

2020-06-17 Thread Quentin Monnet
2020-06-17 09:18 UTC-0700 ~ Andrii Nakryiko > Add statements about bpftool being able to discover process info, holding > reference to BPF map, prog, link, or BTF. Show example output as well. > > Signed-off-by: Andrii Nakryiko > --- > tools/bpf/bpftool/Documentation/bpftool-btf.rst | 5 +

Re: [PATCH bpf-next 8/9] tools/bpftool: show info for processes holding BPF map/prog/link/btf FDs

2020-06-17 Thread Quentin Monnet
2020-06-17 09:18 UTC-0700 ~ Andrii Nakryiko > Add bpf_iter-based way to find all the processes that hold open FDs against > BPF object (map, prog, link, btf). bpftool always attempts to discover this, > but will silently give up if kernel doesn't yet support bpf_iter BPF programs. > Process name a

Re: [RFC PATCH bpf-next 8/8] tools/bpftool: show PIDs with FDs open against BPF map/prog/link/btf

2020-06-15 Thread Quentin Monnet
2020-06-15 11:04 UTC+0200 ~ Toke Høiland-Jørgensen > Arnaldo Carvalho de Melo writes: > >> Em Fri, Jun 12, 2020 at 10:57:59PM -0700, Andrii Nakryiko escreveu: >>> On Fri, Jun 12, 2020 at 8:45 PM Alexei Starovoitov >>> wrote: On Fri, Jun 12, 2020 at 03:31:50PM -0700, Andrii Nakryiko wr

[PATCH bpf-next] tools: bpftool: clean subcommand help messages

2020-05-22 Thread Quentin Monnet
and "bpftool link". Let's reuse this for all other help functions. We can remove up to thirty arguments for the "bpftool map" help message. - Harmonise all functions, e.g. use ending quotes-comma on a separate line. Signed-off-by: Quentin Monnet ---

[PATCH bpf-next v2] tools: bpftool: make capability check account for new BPF caps

2020-05-22 Thread Quentin Monnet
hem in that case). - Keep track of what capabilities we have, print the names of the missing ones for privileged probing. - Attempt to drop only the capabilities we actually have. - Rename a couple variables. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/feature.c | 85 +++

Re: [PATCH bpf-next] tools: bpftool: make capability check account for new BPF caps

2020-05-18 Thread Quentin Monnet
2020-05-18 17:07 UTC-0700 ~ Andrii Nakryiko > On Fri, May 15, 2020 at 5:52 PM Quentin Monnet wrote: >> >> Following the introduction of CAP_BPF, and the switch from CAP_SYS_ADMIN >> to other capabilities for various BPF features, update the capability >> checks

[PATCH bpf-next] tools: bpftool: make capability check account for new BPF caps

2020-05-15 Thread Quentin Monnet
The checks when compiling without libcap (i.e. root versus non-root) are unchanged. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/feature.c | 85 + 1 file changed, 67 insertions(+), 18 deletions(-) diff --git a/tools/bpf/bpftool/feature.c b/tools/b

Re: [PATCH bpf-next] bpf, bpftool: Allow probing for CONFIG_HZ from kernel config

2020-05-13 Thread Quentin Monnet
IG_* can still be added to C macro output at a later time if someone needs them anyway. Regarding a fallback for the jiffies, not sure what would be best. I agree with you for the "full" keyword, so we would need another word I suppose. But adding new keyword for fallbacks for probing features not directly related to BPF might be going a bit beyond bpftool's scope? I don't know. Anyway, for the current patch: Reviewed-by: Quentin Monnet

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

2020-05-11 Thread Quentin Monnet
Synchronise the bpf.h header under tools, to report the fixes recently brought to the documentation for the BPF helpers. Signed-off-by: Quentin Monnet --- tools/include/uapi/linux/bpf.h | 109 ++--- 1 file changed, 59 insertions(+), 50 deletions(-) diff --git a

[PATCH bpf-next v2 2/4] tools: bpftool: minor fixes for documentation

2020-05-11 Thread Quentin Monnet
plete/harmonise/sort the list of related bpftool man pages in footers. v2: - Remove (instead of changing) mark-up on "value" in bpftool-map.rst, when it does not refer to something passed on the command line. - Fix an additional typo ("hexadeximal") in the same file. Sig

[PATCH bpf-next v2 0/4] bpf: clean up bpftool, bpftool doc, bpf-helpers doc

2020-05-11 Thread Quentin Monnet
. Then come the documentation fixes: bpftool, and BPF helpers, with the usual sync up for the BPF header under tools/. Please refer to individual commit logs for details. Quentin Monnet (4): tools: bpftool: poison and replace kernel integer typedefs tools: bpftool: minor fixes for documentation

[PATCH bpf-next v2 3/4] bpf: minor fixes to BPF helpers documentation

2020-05-11 Thread Quentin Monnet
ure probe", including for listing features available to unprivileged users, and add a reference to bpftool man page. Thanks to Florian for reporting two typos (duplicated words). Cc: Florian Weimer Cc: Richard Palethorpe Cc: Michael Kerrisk Signed-off-by: Quentin Monne

[PATCH bpf-next v2 1/4] tools: bpftool: poison and replace kernel integer typedefs

2020-05-11 Thread Quentin Monnet
Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their user space counterpart (__u8, __u32, etc.). Similarly to what libbpf does, poison the typedefs to avoid introducing them again in the future. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/btf_dumper.c| 4

Re: [PATCH bpf-next 2/4] tools: bpftool: minor fixes for documentation

2020-05-11 Thread Quentin Monnet
2020-05-11 17:25 UTC+0200 ~ Daniel Borkmann > On 5/11/20 3:38 PM, Quentin Monnet wrote: >> Bring minor improvements to bpftool documentation. Fix or harmonise >> formatting, update map types (including in interactive help), improve >> description for "map create"

[PATCH bpf-next 1/4] tools: bpftool: poison and replace kernel integer typedefs

2020-05-11 Thread Quentin Monnet
Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their user space counterpart (__u8, __u32, etc.). Similarly to what libbpf does, poison the typedefs to avoid introducing them again in the future. Signed-off-by: Quentin Monnet --- tools/bpf/bpftool/btf_dumper.c| 4

[PATCH bpf-next 3/4] bpf: minor fixes to BPF helpers documentation

2020-05-11 Thread Quentin Monnet
ure probe", including for listing features available to unprivileged users, and add a reference to bpftool man page. Thanks to Florian for reporting two typos (duplicated words). Cc: Florian Weimer Cc: Richard Palethorpe Cc: Michael Kerrisk Signed-off-by: Quentin Monne

  1   2   3   4   5   6   >