diff options
| author | Hou Tao <houtao1@huawei.com> | 2023-06-13 16:09:20 +0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2023-06-19 13:26:43 -0700 |
| commit | 970308a7b544fa1c7ee98a2721faba3765be8dd8 (patch) | |
| tree | cb7756ee7f27382354d2559321306a3ccb4df87b /tools/testing/selftests/bpf/benchs/bench_bpf_loop.c | |
| parent | da77ae2b27ec73a644624a6d4bffc206e2df6bb8 (diff) | |
| download | lwn-970308a7b544fa1c7ee98a2721faba3765be8dd8.tar.gz lwn-970308a7b544fa1c7ee98a2721faba3765be8dd8.zip | |
selftests/bpf: Set the default value of consumer_cnt as 0
Considering that only bench_ringbufs.c supports consumer, just set the
default value of consumer_cnt as 0. After that, update the validity
check of consumer_cnt, remove unused consumer_thread code snippets and
set consumer_cnt as 1 in run_bench_ringbufs.sh accordingly.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230613080921.1623219-5-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/benchs/bench_bpf_loop.c')
| -rw-r--r-- | tools/testing/selftests/bpf/benchs/bench_bpf_loop.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/testing/selftests/bpf/benchs/bench_bpf_loop.c b/tools/testing/selftests/bpf/benchs/bench_bpf_loop.c index d8a0394e10b1..a705cfb2bccc 100644 --- a/tools/testing/selftests/bpf/benchs/bench_bpf_loop.c +++ b/tools/testing/selftests/bpf/benchs/bench_bpf_loop.c @@ -47,8 +47,8 @@ const struct argp bench_bpf_loop_argp = { static void validate(void) { - if (env.consumer_cnt != 1) { - fprintf(stderr, "benchmark doesn't support multi-consumer!\n"); + if (env.consumer_cnt != 0) { + fprintf(stderr, "benchmark doesn't support consumer!\n"); exit(1); } } @@ -62,11 +62,6 @@ static void *producer(void *input) return NULL; } -static void *consumer(void *input) -{ - return NULL; -} - static void measure(struct bench_res *res) { res->hits = atomic_swap(&ctx.skel->bss->hits, 0); @@ -99,7 +94,6 @@ const struct bench bench_bpf_loop = { .validate = validate, .setup = setup, .producer_thread = producer, - .consumer_thread = consumer, .measure = measure, .report_progress = ops_report_progress, .report_final = ops_report_final, |
