]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: adjust strobemeta loop to satisfy latest clang
authorAndrii Nakryiko <andriin@fb.com>
Wed, 25 Sep 2019 18:52:05 +0000 (11:52 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 25 Sep 2019 20:17:11 +0000 (22:17 +0200)
commit1bcb92dbabd69834030087548dc0273c16e74cb1
tree400458520d7bc8ce175d3d13f6440c3b21a22371
parentef2bf0875406c6022da4a0625bdbb134dd0d3fba
selftests/bpf: adjust strobemeta loop to satisfy latest clang

Some recent changes in latest Clang started causing the following
warning when unrolling strobemeta test case main loop:

  progs/strobemeta.h:416:2: warning: loop not unrolled: the optimizer was
  unable to perform the requested transformation; the transformation might
  be disabled or specified as part of an unsupported transformation
  ordering [-Wpass-failed=transform-warning]

This patch simplifies loop's exit condition to depend only on constant
max iteration number (STROBE_MAX_MAP_ENTRIES), while moving early
termination logic inside the loop body. The changes are equivalent from
program logic standpoint, but fixes the warning. It also appears to
improve generated BPF code, as it fixes previously failing non-unrolled
strobemeta test cases.

Cc: Alexei Starovoitov <ast@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/progs/strobemeta.h