]> www.infradead.org Git - users/dwmw2/linux.git/commit
bpf: Consolidate shared test timing code
authorLorenz Bauer <lmb@cloudflare.com>
Mon, 1 Aug 2022 07:29:14 +0000 (15:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:00:52 +0000 (12:00 +0200)
commit6aad811b37eeeba902b14cc4ab698d2b37bb4fb9
treed5c27f0e72394c26e064438e5a514fa607b6ba4b
parent545fc3524ccc454d9f24273ee1c3aeadd7ab1421
bpf: Consolidate shared test timing code

commit 607b9cc92bd7208338d714a22b8082fe83bcb177 upstream.

Share the timing / signal interruption logic between different
implementations of PROG_TEST_RUN. There is a change in behaviour
as well. We check the loop exit condition before checking for
pending signals. This resolves an edge case where a signal
arrives during the last iteration. Instead of aborting with
EINTR we return the successful result to user space.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210303101816.36774-2-lmb@cloudflare.com
[dtcccc: fix conflicts in bpf_test_run()]
Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bpf/test_run.c