Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bpftool sync 2024-04-02 #139

Merged
merged 9 commits into from
Apr 2, 2024

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Apr 2, 2024

This is not a regular update based on libbpf's sync-up; instead, we intentionally update to kernel-patches/bpf@2a24e24 to pick up that commit and fix warnings observed by users.

$ BPF_NEXT_TIP_COMMIT=2a24e2485722b0e12e17a2bd473bd15c9e420bdb ./scripts/sync-kernel.sh . <path/to/>linux

Cc @anakryiko

mykyta5 and others added 9 commits March 25, 2024 15:22
BPF verifier emits "unknown func" message when given BPF program type
does not support BPF helper. This message may be confusing for users, as
important context that helper is unknown only to current program type is
not provided.

This patch changes message to "program of this type cannot use helper "
and aligns dependent code in libbpf and tests. Any suggestions on
improving/changing this message are welcome.

Signed-off-by: Mykyta Yatsenko <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Acked-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
The rST manual pages for bpftool would use a mix of tabs and spaces for
indentation. While this is the norm in C code, this is rather unusual
for rST documents, and over time we've seen many contributors use a
wrong level of indentation for documentation update.

Let's fix bpftool's indentation in docs once and for all:

- Let's use spaces, that are more common in rST files.
- Remove one level of indentation for the synopsis, the command
  description, and the "see also" section. As a result, all sections
  start with the same indentation level in the generated man page.
- Rewrap the paragraphs after the changes.

There is no content change in this patch, only indentation and
rewrapping changes. The wrapping in the generated source files for the
manual pages is changed, but the pages displayed with "man" remain the
same, apart from the adjusted indentation level on relevant sections.

[ Quentin: rebased on bpf-next, removed indent level for command
  description and options, updated synopsis, command summary, and "see
  also" sections. ]

Signed-off-by: Rameez Rehman <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
As it turns out, the terms in definition lists in the rST file are
already rendered with bold-ish formatting when generating the man pages;
all double-star sequences we have in the commands for the command
description are unnecessary, and can be removed to make the
documentation easier to read.

The rST files were automatically processed with:

    sed -i '/DESCRIPTION/,/OPTIONS/ { /^\*/ s/\*\*//g }' b*.rst

Signed-off-by: Rameez Rehman <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Improve the formatting of the attach flags for cgroup programs in the
relevant man page, and fix typos ("can be on of", "an userspace inet
socket") when introducing that list. Also fix a couple of other trivial
issues in docs.

[ Quentin: Fixed trival issues in bpftool-gen.rst and bpftool-iter.rst ]

Signed-off-by: Rameez Rehman <[email protected]>
Signed-off-by: Quentin Monnet <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
In a few places in the bpf uapi headers, EOPNOTSUPP is missing a "P" in
the doc comments. This adds the missing "P".

Signed-off-by: David Lechner <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
When generated BPF skeleton header is included in C++ code base, some
compiler setups will emit warning about using language extensions due to
typeof() usage, resulting in something like:

  error: extension used [-Werror,-Wlanguage-extension-token]
  obj->struct_ops.empty_tcp_ca = (typeof(obj->struct_ops.empty_tcp_ca))
                                  ^

It looks like __typeof__() is a preferred way to do typeof() with better
C++ compatibility behavior, so switch to that. With __typeof__() we get
no such warning.

Fixes: c2a0257c1edf ("bpftool: Cast pointers for shadow types explicitly.")
Fixes: 00389c58ffe9 ("bpftool: Add support for subskeletons")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Kui-Feng Lee <[email protected]>
Acked-by: Quentin Monnet <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Pull latest libbpf from mirror.
Libbpf version: 1.4.0
Libbpf commit:  6d3595d215b014d3eddb88038d686e1c20781534

Signed-off-by: Quentin Monnet <[email protected]>
Extend the bpf_fib_lookup() helper by making it to utilize mark if
the BPF_FIB_LOOKUP_MARK flag is set. In order to pass the mark the
four bytes of struct bpf_fib_lookup are used, shared with the
output-only smac/dmac fields.

Signed-off-by: Anton Protopopov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Syncing latest bpftool commits from kernel repository.
Baseline bpf-next commit:   14bb1e8c8d4ad5d9d2febb7d19c70a3cf536e1e5
Checkpoint bpf-next commit: 2a24e2485722b0e12e17a2bd473bd15c9e420bdb
Baseline bpf commit:        443574b033876c85a35de4c65c14f7fe092222b2
Checkpoint bpf commit:      443574b033876c85a35de4c65c14f7fe092222b2

Andrii Nakryiko (1):
  bpftool: Use __typeof__() instead of typeof() in BPF skeleton

Anton Protopopov (1):
  bpf: Add support for passing mark with bpf_fib_lookup

David Lechner (1):
  bpf: Fix typo in uapi doc comments

Mykyta Yatsenko (1):
  bpf: improve error message for unsupported helper

Rameez Rehman (3):
  bpftool: Use simpler indentation in source rST for documentation
  bpftool: Remove useless emphasis on command description in man pages
  bpftool: Clean-up typos, punctuation, list formatting in docs

 docs/Makefile               |   6 +-
 docs/bpftool-btf.rst        | 116 +++++-----
 docs/bpftool-cgroup.rst     | 193 ++++++++--------
 docs/bpftool-feature.rst    | 115 +++++-----
 docs/bpftool-gen.rst        | 338 +++++++++++++---------------
 docs/bpftool-iter.rst       |  52 ++---
 docs/bpftool-link.rst       |  73 +++---
 docs/bpftool-map.rst        | 232 ++++++++++----------
 docs/bpftool-net.rst        |  98 ++++-----
 docs/bpftool-perf.rst       |  34 +--
 docs/bpftool-prog.rst       | 426 +++++++++++++++++-------------------
 docs/bpftool-struct_ops.rst |  71 +++---
 docs/bpftool.rst            |  60 ++---
 docs/common_options.rst     |  26 +--
 include/uapi/linux/bpf.h    |  24 +-
 src/feature.c               |   3 +-
 src/gen.c                   |   4 +-
 17 files changed, 900 insertions(+), 971 deletions(-)

Signed-off-by: Quentin Monnet <[email protected]>
@qmonnet qmonnet merged commit 0b5a81c into libbpf:main Apr 2, 2024
6 checks passed
@qmonnet qmonnet deleted the bpftool-sync-2024-04-02T21-06-54.505Z branch April 2, 2024 21:21
@anakryiko
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants