bpf: wq: add bpf_wq_init
authorBenjamin Tissoires <bentiss@kernel.org>
Sat, 20 Apr 2024 09:09:11 +0000 (11:09 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 24 Apr 2024 02:46:57 +0000 (19:46 -0700)
commiteb48f6cd41a0f7803770a76bbffb6bd5b1b2ae2f
tree46da490f63b2559a7d0915df149ab549f7ab0fdf
parentb4abee7c1ae3d59440e7915da28c6d2cd394738a
bpf: wq: add bpf_wq_init

We need to teach the verifier about the second argument which is declared
as void * but which is of type KF_ARG_PTR_TO_MAP. We could have dropped
this extra case if we declared the second argument as struct bpf_map *,
but that means users will have to do extra casting to have their program
compile.

We also need to duplicate the timer code for the checking if the map
argument is matching the provided workqueue.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240420-bpf_wq-v2-11-6c986a5a741f@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/helpers.c