diff options
author | Eduard Zingerman <eddyz87@gmail.com> | 2023-11-21 05:06:58 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-11-21 05:36:40 +0300 |
commit | cafe2c21508a38cdb3ed22708842e957b2572c3e (patch) | |
tree | b93ff2494a5347ae9e13f76e51dbba0147560cbe /tools | |
parent | 958465e217dbf5fc6677d42d8827fb3073d86afd (diff) | |
download | linux-cafe2c21508a38cdb3ed22708842e957b2572c3e.tar.xz |
bpf: widening for callback iterators
Callbacks are similar to open coded iterators, so add imprecise
widening logic for callback body processing. This makes callback based
loops behave identically to open coded iterators, e.g. allowing to
verify programs like below:
struct ctx { u32 i; };
int cb(u32 idx, struct ctx* ctx)
{
++ctx->i;
return 0;
}
...
struct ctx ctx = { .i = 0 };
bpf_loop(100, cb, &ctx, 0);
...
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20231121020701.26440-9-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions