Skip to content

Commit 4d251a0

Browse files
theihorKernel Patches Daemon
authored andcommitted
selftests/bpf: update bpf_wq_set_callback macro
Subsequent patch introduces bpf_wq_set_callback kfunc with an implicit bpf_prog_aux argument. To ensure backward compatibility add a weak declaration and make bpf_wq_set_callback macro to check for the new kfunc first. Signed-off-by: Ihor Solodrai <[email protected]>
1 parent 6417218 commit 4d251a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/testing/selftests/bpf/bpf_experimental.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,13 @@ extern int bpf_wq_start(struct bpf_wq *wq, unsigned int flags) __weak __ksym;
583583
extern int bpf_wq_set_callback_impl(struct bpf_wq *wq,
584584
int (callback_fn)(void *map, int *key, void *value),
585585
unsigned int flags__k, void *aux__ign) __ksym;
586+
extern int bpf_wq_set_callback(struct bpf_wq *wq,
587+
int (callback_fn)(void *map, int *key, void *value),
588+
unsigned int flags) __weak __ksym;
586589
#define bpf_wq_set_callback(timer, cb, flags) \
587-
bpf_wq_set_callback_impl(timer, cb, flags, NULL)
590+
(bpf_wq_set_callback ? \
591+
bpf_wq_set_callback(timer, cb, flags) : \
592+
bpf_wq_set_callback_impl(timer, cb, flags, NULL))
588593

589594
struct bpf_iter_kmem_cache;
590595
extern int bpf_iter_kmem_cache_new(struct bpf_iter_kmem_cache *it) __weak __ksym;

0 commit comments

Comments
 (0)