Skip to content

libbpf: minimize feature detection (reallocarray, libelf-mmap)

Andrii Nakryiko bpf netdev 3 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 1 replyApplied
  2. v24 patches 2 repliesSuperseded
  3. v14 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- rebase to latest bpf-next (Alexei).

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4libbpf: remove any use of reallocarray() in libbpftools/lib/bpf/Makefile tools/lib/bpf/btf.c tools/lib/bpf/btf_dump.c +3 more+45 -290 replies
2/4tools/bpftool: remove libbpf_internal.h usage in bpftooltools/bpf/bpftool/gen.c tools/bpf/bpftool/net.c tools/lib/bpf/libbpf_internal.h +1 more+288 -1500 replies
3/4libbpf: centralize poisoning and poison reallocarray()tools/lib/bpf/bpf.c tools/lib/bpf/bpf_prog_linfo.c tools/lib/bpf/btf.c +9 more+13 -330 replies
4/4tools: remove feature-libelf-mmap feature detectiontools/build/Makefile.feature tools/build/feature/Makefile tools/build/feature/test-all.c +5 more+8 -360 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

Get rid of two feature detectors: reallocarray and libelf-mmap. Optional feature detections complicate libbpf Makefile and cause more troubles for various applications that want to integrate libbpf as part of their build.

Patch #1 replaces all reallocarray() uses into libbpf-internal reallocarray() implementation. Patches #2 and #3 makes sure we won't re-introduce reallocarray() accidentally. Patch #2 also removes last use of libbpf_internal.h header inside bpftool. There is still nlattr.h that's used by both libbpf and bpftool, but that's left for a follow up patch to split. Patch #4 removed libelf-mmap feature detector and all its uses, as it's trivial to handle missing mmap support in libbpf, the way objtool has been doing it for a while.

v1->v2 and v2->v3:
- rebase to latest bpf-next (Alexei).

Andrii Nakryiko (4):
libbpf: remove any use of reallocarray() in libbpf tools/bpftool: remove libbpf_internal.h usage in bpftool
libbpf: centralize poisoning and poison reallocarray()
tools: remove feature-libelf-mmap feature detection

 tools/bpf/bpftool/gen.c                |   2 -
 tools/bpf/bpftool/net.c                | 299 +++++++++++++++++++++++--
 tools/build/Makefile.feature           |   1 -
 tools/build/feature/Makefile           |   4 -
 tools/build/feature/test-all.c         |   4 -
 tools/build/feature/test-libelf-mmap.c |   9 -
 tools/lib/bpf/Makefile                 |  10 +-
 tools/lib/bpf/bpf.c                    |   3 -
 tools/lib/bpf/bpf_prog_linfo.c         |   3 -
 tools/lib/bpf/btf.c                    |  14 +-
 tools/lib/bpf/btf_dump.c               |   9 +-
 tools/lib/bpf/hashmap.c                |   3 +
 tools/lib/bpf/libbpf.c                 |  38 ++--
 tools/lib/bpf/libbpf_internal.h        |  44 +++-
 tools/lib/bpf/libbpf_probes.c          |   3 -
 tools/lib/bpf/netlink.c                | 128 +----------
 tools/lib/bpf/nlattr.c                 |   9 +-
 tools/lib/bpf/ringbuf.c                |   8 +-
 tools/lib/bpf/xsk.c                    |   3 -
 tools/perf/Makefile.config             |   4 -
 tools/perf/util/symbol.h               |   2 +-
 21 files changed, 353 insertions(+), 247 deletions(-)
 delete mode 100644 tools/build/feature/test-libelf-mmap.c
Signature · 1 line
2.24.1