bpf: Support bpf rbtree traversal and list peeking
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
- v2 Latest8 patches 0 repliesApplied 8/8
- v1 RFC12 patches 14 repliesSuperseded
Changes in v2 from the cover letter
- Added tests to check that the return value of
the bpf_rbtree_{root,left,right} and bpf_list_{front,back} is marked as a non_own_ref node pointer. (Kumar)
- Added tests to ensure that the bpf_rbtree_{root,left,right} and bpf_list_{front,back} must be called after holding the spinlock.
- Squashed the selftests adjustment to the corresponding verifier changes to avoid bisect failure. (Kumar)
- Separated the bpf qdisc specific changes and fq selftest example from this set.
Patches in v2 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | bpf: Check KF_bpf_rbtree_add_impl for the "case KF_ARG_PTR_TO_RB_NODE"kernel/ | +9 | 0 replies | Applied |
| 2/8 | bpf: Simplify reg0 marking for the rbtree kfuncs that return a bpf_rb_node pointerkernel/ | +7 | 0 replies | Applied |
| 3/8 | bpf: Add bpf_rbtree_{root,left,right} kfunckernel/ kernel/ | +48 | 0 replies | Applied |
| 4/8 | bpf: Allow refcounted bpf_rb_node used in bpf_rbtree_{remove,left,right}kernel/ tools/ | +17 | 0 replies | Applied |
| 5/8 | selftests/bpf: Add tests for bpf_rbtree_{root,left,right}tools/ tools/ | +212 | 0 replies | Applied |
| 6/8 | bpf: Simplify reg0 marking for the list kfuncs that return a bpf_list_node pointerkernel/ | +6 | 0 replies | Applied |
| 7/8 | bpf: Add bpf_list_{front,back} kfunckernel/ kernel/ | +32 | 0 replies | Applied |
| 8/8 | selftests/bpf: Add test for bpf_list_{front,back}tools/ tools/ | +119 | 0 replies | Applied |
Reviews trailers per patch
6 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Kumar Kartikeya Dwivedi |
|---|---|
| 1/8 | A-b |
| 2/8 | A-b |
| 3/8 | A-b |
| 4/8 | A-b |
| 5/8 | |
| 6/8 | A-b |
| 7/8 | A-b |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 bpf-next 0/8] bpf: Support bpf rbtree traversal and list peeking
From: Martin KaFai Lau <[email protected]>
The RFC v1 [1] showed a fq qdisc implementation in bpf that is much closer to the kernel sch_fq.c.
The fq example and bpf qdisc changes are separated out from this set. This set is to focus on the kfunc and verifier changes that enable the bpf rbtree traversal and list peeking.
v2:
- Added tests to check that the return value of
the bpf_rbtree_{root,left,right} and bpf_list_{front,back} is marked as a non_own_ref node pointer. (Kumar)
- Added tests to ensure that the bpf_rbtree_{root,left,right} and bpf_list_{front,back} must be called after holding the spinlock.
- Squashed the selftests adjustment to the corresponding verifier changes to avoid bisect failure. (Kumar)
- Separated the bpf qdisc specific changes and fq selftest example from this set.
[1]: https://lore.kernel.org/bpf/[email protected]/
Martin KaFai Lau (8):
bpf: Check KF_bpf_rbtree_add_impl for the "case KF_ARG_PTR_TO_RB_NODE"
bpf: Simplify reg0 marking for the rbtree kfuncs that return a
bpf_rb_node pointer
bpf: Add bpf_rbtree_{root,left,right} kfunc
bpf: Allow refcounted bpf_rb_node used in
bpf_rbtree_{remove,left,right} selftests/bpf: Add tests for bpf_rbtree_{root,left,right}
bpf: Simplify reg0 marking for the list kfuncs that return a
bpf_list_node pointer
bpf: Add bpf_list_{front,back} kfunc selftests/bpf: Add test for bpf_list_{front,back}
kernel/bpf/helpers.c | 52 +++++ kernel/bpf/verifier.c | 64 ++++-- .../selftests/bpf/prog_tests/linked_list.c | 6 + .../testing/selftests/bpf/prog_tests/rbtree.c | 6 + .../selftests/bpf/progs/linked_list_peek.c | 113 ++++++++++ .../testing/selftests/bpf/progs/rbtree_fail.c | 29 +-- .../selftests/bpf/progs/rbtree_search.c | 206 ++++++++++++++++++ 7 files changed, 445 insertions(+), 31 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/linked_list_peek.c create mode 100644 tools/testing/selftests/bpf/progs/rbtree_search.c
Signature · 1 line
2.47.1