We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
bpf_core_enum_value_exists
bpf_loop
1 parent 7a0226f commit cdeebb3Copy full SHA for cdeebb3
crates/bpf-builder/include/loop.bpf.h
@@ -16,14 +16,7 @@
16
// function seems to cause issues.
17
#ifdef FEATURE_BPF_LOOP
18
#define LOOP(max_iterations, max_unroll, callback_fn, ctx) \
19
- if (bpf_core_enum_value_exists(enum bpf_func_id, BPF_FUNC_loop)) { \
20
- bpf_loop(max_iterations, callback_fn, ctx, 0); \
21
- } else { \
22
- _Pragma("unroll") for (int i = 0; i < max_unroll; i++) { \
23
- if (callback_fn(i, ctx) == LOOP_STOP) \
24
- break; \
25
- } \
26
- }
+ bpf_loop(max_iterations, callback_fn, ctx, 0);
27
#else
28
// On kernel <= 5.13 taking the address of a function results in a verifier
29
// error, even if inside a dead-code elimination branch.
0 commit comments