Skip to content

bpf: Omit inlined bounds checks for null elided map lookups

Daniel Xu bpf lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: verifier: Store null elision decision in insn_aux_datainclude/linux/bpf_verifier.h kernel/bpf/verifier.c+7 -11 reply
2/3bpf: map: Thread null elision metadata to map_gen_lookupinclude/linux/bpf.h kernel/bpf/arraymap.c kernel/bpf/hashtab.c +2 more+23 -101 reply
3/3bpf: arraymap: Skip boundscheck during inlining when possiblekernel/bpf/arraymap.c+14 -102 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] bpf: Omit inlined bounds checks for null elided map lookups

This follows up the null elision patchset with a corresponding codegen change. When the lookup is known to be inbounds, the inlined lookup can skip the bounds check.

See final commit for the JIT diff.

Daniel Xu (3):
bpf: verifier: Store null elision decision in insn_aux_data
bpf: map: Thread null elision metadata to map_gen_lookup
bpf: arraymap: Skip boundscheck during inlining when possible

 include/linux/bpf.h          |  2 +-
 include/linux/bpf_verifier.h |  4 ++++
 kernel/bpf/arraymap.c        | 35 ++++++++++++++++++++++-------------
 kernel/bpf/hashtab.c         | 14 ++++++++++----
 kernel/bpf/verifier.c        |  6 ++++--
 net/xdp/xskmap.c             |  4 +++-
 6 files changed, 44 insertions(+), 21 deletions(-)
Signature · 1 line
2.47.1