Skip to content

Commit 37bd6c8

Browse files
mykyta5qmonnet
authored andcommitted
bpf: bpf task work plumbing
This patch adds necessary plumbing in verifier, syscall and maps to support handling new kfunc bpf_task_work_schedule and kernel structure bpf_task_work. The idea is similar to how we already handle bpf_wq and bpf_timer. verifier changes validate calls to bpf_task_work_schedule to make sure it is safe and expected invariants hold. btf part is required to detect bpf_task_work structure inside map value and store its offset, which will be used in the next patch to calculate key and value addresses. arraymap and hashtab changes are needed to handle freeing of the bpf_task_work: run code needed to deinitialize it, for example cancel task_work callback if possible. The use of bpf_task_work and proper implementation for kfuncs are introduced in the next patch. Signed-off-by: Mykyta Yatsenko <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Acked-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 6b9405a commit 37bd6c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/uapi/linux/bpf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7436,6 +7436,10 @@ struct bpf_timer {
74367436
__u64 __opaque[2];
74377437
} __attribute__((aligned(8)));
74387438

7439+
struct bpf_task_work {
7440+
__u64 __opaque;
7441+
} __attribute__((aligned(8)));
7442+
74397443
struct bpf_wq {
74407444
__u64 __opaque[2];
74417445
} __attribute__((aligned(8)));

0 commit comments

Comments
 (0)