summaryrefslogtreecommitdiffstats
path: root/lib/test_bpf.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-02-26 10:52:46 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2018-02-26 21:06:56 +0100
commitd40bc96257fe070796c63934913f95cc183016b0 (patch)
treeb872eba57b4344a350001fdfed1884eff5ef87d3 /lib/test_bpf.c
parentca36960211eb228bcbc7aaebfa0d027368a94c60 (diff)
downloadop-kernel-dev-d40bc96257fe070796c63934913f95cc183016b0.zip
op-kernel-dev-d40bc96257fe070796c63934913f95cc183016b0.tar.gz
test_bpf: add a schedule point
test_bpf() is taking 1.6 seconds nowadays, it is time to add a schedule point in it. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r--lib/test_bpf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index b4e2234..e6f5506 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -24,6 +24,7 @@
#include <linux/if_vlan.h>
#include <linux/random.h>
#include <linux/highmem.h>
+#include <linux/sched.h>
/* General test specific settings */
#define MAX_SUBTESTS 3
@@ -6582,6 +6583,7 @@ static __init int test_bpf(void)
struct bpf_prog *fp;
int err;
+ cond_resched();
if (exclude_test(i))
continue;
OpenPOWER on IntegriCloud