diff options
author | Martin KaFai Lau <martin.lau@kernel.org> | 2025-05-06 04:58:49 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2025-05-06 20:21:05 +0300 |
commit | 7faccdf4b47d2c7674692aecdb5847da0f84dbd4 (patch) | |
tree | 093191453836dcef715b7e060cf4316a5514188c /scripts/bpf_doc.py | |
parent | b183c0123d9ba16e147c990c02a9e6f37cac5df4 (diff) | |
download | linux-7faccdf4b47d2c7674692aecdb5847da0f84dbd4.tar.xz |
bpf: Simplify reg0 marking for the rbtree kfuncs that return a bpf_rb_node pointer
The current rbtree kfunc, bpf_rbtree_{first, remove}, returns the
bpf_rb_node pointer. The check_kfunc_call currently checks the
kfunc btf_id instead of its return pointer type to decide
if it needs to do mark_reg_graph_node(reg0) and ref_set_non_owning(reg0).
The later patch will add bpf_rbtree_{root,left,right} that will also
return a bpf_rb_node pointer. Instead of adding more kfunc btf_id
checks to the "if" case, this patch changes the test to check the
kfunc's return type. is_rbtree_node_type() function is added to
test if a pointer type is a bpf_rb_node. The callers have already
skipped the modifiers of the pointer type.
A note on the ref_set_non_owning(), although bpf_rbtree_remove()
also returns a bpf_rb_node pointer, the bpf_rbtree_remove()
has the KF_ACQUIRE flag. Thus, its reg0 will not become non-owning.
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20250506015857.817950-3-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions