Skip to content

Make bpf_endian.h compatible with vmlinux.h

Andrii Nakryiko bpf netdev 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 2 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Changes in v3 from the cover letter

- explicit zero-initialization of global variables (Daniel);

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libbpf: make bpf_endian co-exist with vmlinux.htools/lib/bpf/bpf_endian.h+35 -80 replies
2/2selftests/bpf: add byte swapping selftesttools/testing/selftests/bpf/prog_tests/endian.c tools/testing/selftests/bpf/progs/test_endian.c+90 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYonghong Song
SeriesA-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 bpf-next 0/2] Make bpf_endian.h compatible with vmlinux.h

Change libbpf's bpf_endian.h header to be compatible when used with system headers and when using just vmlinux.h. This is a frequent request for users writing BPF CO-RE applications. Do this by re-implementing byte swap compile-time macros. Also add simple tests validating correct results both for byte-swapping built-ins and macros.

v2->v3:
- explicit zero-initialization of global variables (Daniel);

v1->v2:
- reimplement byte swapping macros (Alexei).

Andrii Nakryiko (2):
libbpf: make bpf_endian co-exist with vmlinux.h
selftests/bpf: add byte swapping selftest

 tools/lib/bpf/bpf_endian.h                    | 43 ++++++++++++---
 .../testing/selftests/bpf/prog_tests/endian.c | 53 +++++++++++++++++++
 .../testing/selftests/bpf/progs/test_endian.c | 37 +++++++++++++
 3 files changed, 125 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/endian.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_endian.c
Signature · 1 line
2.24.1