Skip to content

bpf/arm64: add BPF_ABS/BPF_IND packet load support

Stephen Hemminger dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf/arm64: fix zero-return branch in multi-exit programslib/bpf/bpf_jit_arm64.c+1 -11 reply
2/4test: bpf check that JIT was generatedapp/test/test_bpf.c+8 -01 reply
3/4test: bpf check that bpf_convert can be JIT'dapp/test/test_bpf.c+14 -11 reply
4/4bpf/arm64: add BPF_ABS/BPF_IND packet load supportlib/bpf/bpf_jit_arm64.c+146 -11 reply

Reviews trailers per patch

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

PatchMarat KhaliliKonstantin Ananyev
SeriesA-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b Series-tested-by Series-Acked-by
1/4
2/4A-b
3/4A-b
4/4

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

Read the v1 thread

Cover letter [PATCH 0/4] bpf/arm64: add BPF_ABS/BPF_IND packet load support

Discovered this while exploring packet filtering.
The arm64 BPF JIT did not implement BPF_LD | BPF_ABS or BPF_LD | BPF_IND, so cBPF filters converted by rte_bpf_convert() could not be JIT compiled and silently fell back to the interpreter on arm64.

The first patch fixes a latent bug in emit_return_zero_if_src_zero():
the offset of the branch to the epilogue was held in an unsigned. A backward branch wrapped around. Existing JIT tests were never being run on ARM.

The next two patches make the bpf tests assert that,
on an architecture with a JITbackend, code is actually generated, so a missing or failed JIT is reported rather than skipped.

The final patch adds the ABS/IND opcodes, mirroring the x86 JIT with a fast path for data in the first
mbuf segment and a __rte_pktmbuf_read() slow path for the rest.

Stephen Hemminger (4):
bpf/arm64: fix zero-return branch in multi-exit programs
test: bpf check that JIT was generated
test: bpf check that bpf_convert can be JIT'd bpf/arm64: add BPF_ABS/BPF_IND packet load support

 app/test/test_bpf.c     |  23 ++++++-
 lib/bpf/bpf_jit_arm64.c | 149 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 169 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0