Skip to content

bpf: bpf link iterator

Dmitrii Dolgov bpf 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesApplied 4/4
  2. v1 RFC2 patches 6 repliesSuperseded

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4bpf: Add bpf_link iteratorinclude/linux/bpf.h kernel/bpf/Makefile kernel/bpf/link_iter.c +1 more+128 -10 repliesApplied
2/4selftests/bpf: Fix result check for test_bpf_hash_maptools/testing/selftests/bpf/prog_tests/bpf_iter.c+1 -20 repliesApplied
3/4selftests/bpf: Use ASSERT_* instead of CHECKtools/testing/selftests/bpf/prog_tests/bpf_iter.c+88 -1540 repliesApplied
4/4selftests/bpf: Add bpf link iter testtools/testing/selftests/bpf/prog_tests/bpf_iter.c tools/testing/selftests/bpf/progs/bpf_iter.h tools/testing/selftests/bpf/progs/bpf_iter_bpf_link.c+44 -00 repliesApplied

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchYonghong Song
1/4A-b
2/4
3/4
4/4

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/4] bpf: bpf link iterator

Bpf links seem to be one of the important structures for which no iterator is provided. Such iterator could be useful in those cases when generic 'task/file' is not suitable or better performance is needed.

The implementation is mostly copied from prog iterator. This time tests were executed, although I still had to exclude test_bpf_nf (failed to find BTF info for global/extern symbol 'bpf_skb_ct_lookup') -- since it's unrelated, I hope it's a minor issue.

Per suggestion from the previous discussion, there is a new patch for converting CHECK to corresponding ASSERT_* macro. Such replacement is done only if the final result would be the same, e.g. CHECK with important-looking custom formatting strings are still in place -- from what I understand ASSERT_* doesn't allow to specify such format.

The third small patch fixes what looks like a copy-paste error in the condition checking.

Dmitrii Dolgov (4):
bpf: Add bpf_link iterator
selftests/bpf: Fix result check for test_bpf_hash_map selftests/bpf: Use ASSERT_* instead of CHECK selftests/bpf: Add bpf link iter test

 include/linux/bpf.h                           |   1 +
 kernel/bpf/Makefile                           |   2 +-
 kernel/bpf/link_iter.c                        | 107 +++++++
 kernel/bpf/syscall.c                          |  19 ++
 .../selftests/bpf/prog_tests/bpf_iter.c       | 261 +++++++-----------
 tools/testing/selftests/bpf/progs/bpf_iter.h  |   7 +
 .../selftests/bpf/progs/bpf_iter_bpf_link.c   |  21 ++
 7 files changed, 261 insertions(+), 157 deletions(-)
 create mode 100644 kernel/bpf/link_iter.c
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_iter_bpf_link.c
Signature · 1 line
2.32.0