]> git.baikalelectronics.ru Git - kernel.git/commit
test_bpf: reduce MAX_TESTRUNS
authorEric Dumazet <edumazet@google.com>
Wed, 28 Feb 2018 16:39:20 +0000 (08:39 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 28 Feb 2018 16:49:18 +0000 (17:49 +0100)
commitb70e03ceb1983a884c505f3c5a8cb1d18305d634
tree49750e25e95281c96340234d2f71b2e0539fe2b1
parenteb90af72386502660949626a904a0a5bc25e8941
test_bpf: reduce MAX_TESTRUNS

For tests that are using the maximal number of BPF instruction, each
run takes 20 usec. Looping 10,000 times on them totals 200 ms, which
is bad when the loop is not preemptible.

test_bpf: #264 BPF_MAXINSNS: Call heavy transformations jited:1 19248
18548 PASS
test_bpf: #269 BPF_MAXINSNS: ld_abs+get_processor_id jited:1 20896 PASS

Lets divide by ten the number of iterations, so that max latency is
20ms. We could use need_resched() to break the loop earlier if we
believe 20 ms is too much.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
lib/test_bpf.c