diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-08-16 03:19:29 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-08-17 23:43:58 +0300 |
commit | df78da27260c915039b348b164bbc53fa372ba70 (patch) | |
tree | bdc324ba085f94b9c347627ebb06b9a07b6f3943 /tools/testing/selftests/bpf/xskxceiver.c | |
parent | abf84b64e36b175c9c4dd4ecbad2af4329c00041 (diff) | |
download | linux-df78da27260c915039b348b164bbc53fa372ba70.tar.xz |
selftests/bpf: Few fixes for selftests/bpf built in release mode
Fix few issues found when building and running test_progs in
release mode.
First, potentially uninitialized idx variable in xskxceiver,
force-initialize to zero to satisfy compiler.
Few instances of defining uprobe trigger functions break in release mode
unless marked as noinline, due to being static. Add noinline to make
sure everything works.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Hao Luo <haoluo@google.com>
Link: https://lore.kernel.org/bpf/20220816001929.369487-5-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/xskxceiver.c')
-rw-r--r-- | tools/testing/selftests/bpf/xskxceiver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index 20b44ab32a06..14b4737b223c 100644 --- a/tools/testing/selftests/bpf/xskxceiver.c +++ b/tools/testing/selftests/bpf/xskxceiver.c @@ -922,7 +922,7 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb, struct pollfd *fd { struct xsk_socket_info *xsk = ifobject->xsk; bool use_poll = ifobject->use_poll; - u32 i, idx, ret, valid_pkts = 0; + u32 i, idx = 0, ret, valid_pkts = 0; while (xsk_ring_prod__reserve(&xsk->tx, BATCH_SIZE, &idx) < BATCH_SIZE) { if (use_poll) { |