From: Martin KaFai Lau <martin.lau@linux.dev>
To: Vadim Fedorenko <vadfed@meta.com>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Jakub Kicinski <kuba@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Mykola Lysenko <mykolal@fb.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
netdev@vger.kernel.org, linux-crypto@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v10 4/4] selftests: bpf: crypto: add benchmark for crypto functions
Date: Wed, 24 Apr 2024 15:43:02 -0700 [thread overview]
Message-ID: <54ff0e5d-1089-4370-913a-d4fdf2fd8ad1@linux.dev> (raw)
In-Reply-To: <20240422225024.2847039-5-vadfed@meta.com>
On 4/22/24 3:50 PM, Vadim Fedorenko wrote:
> diff --git a/tools/testing/selftests/bpf/benchs/bench_bpf_crypto.c b/tools/testing/selftests/bpf/benchs/bench_bpf_crypto.c
> new file mode 100644
> index 000000000000..0b8c1f2fe7e6
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/benchs/bench_bpf_crypto.c
> @@ -0,0 +1,185 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
> +
> +#include <argp.h>
> +#include "bench.h"
> +#include "crypto_bench.skel.h"
> +
> +#define MAX_CIPHER_LEN 32
> +static char *input;
[ ... ]
> +static void *crypto_producer(void *input)
The bench result has all 0s in the output:
$> ./bench -p 4 crypto-decrypt
Setting up benchmark 'crypto-decrypt'...
Benchmark 'crypto-decrypt' started.
Iter 0 (209.082us): hits 0.000M/s ( 0.000M/prod), drops 0.000M/s, total operations 0.000M/s
Iter 1 (154.618us): hits 0.000M/s ( 0.000M/prod), drops 0.000M/s, total operations 0.000M/s
Iter 2 (-36.658us): hits 0.000M/s ( 0.000M/prod), drops 0.000M/s, total operations 0.000M/s
This "void *input" arg shadowed the global variable.
> +{
> + LIBBPF_OPTS(bpf_test_run_opts, opts,
> + .repeat = 64,
> + .data_in = input,
> + .data_size_in = args.crypto_len,
> + );
> +
> + while (true)
> + (void)bpf_prog_test_run_opts(ctx.pfd, &opts);
> + return NULL;
> +}
next prev parent reply other threads:[~2024-04-24 22:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 22:50 [PATCH bpf-next v10 0/4] BPF crypto API framework Vadim Fedorenko
2024-04-22 22:50 ` [PATCH bpf-next v10 1/4] bpf: make common crypto API for TC/XDP programs Vadim Fedorenko
2024-04-23 11:56 ` kernel test robot
2024-04-24 23:04 ` Martin KaFai Lau
2024-04-22 22:50 ` [PATCH bpf-next v10 2/4] bpf: crypto: add skcipher to bpf crypto Vadim Fedorenko
2024-04-22 22:50 ` [PATCH bpf-next v10 3/4] selftests: bpf: crypto skcipher algo selftests Vadim Fedorenko
2024-04-22 22:50 ` [PATCH bpf-next v10 4/4] selftests: bpf: crypto: add benchmark for crypto functions Vadim Fedorenko
2024-04-24 22:43 ` Martin KaFai Lau [this message]
2024-04-24 23:00 ` Vadim Fedorenko
2024-04-24 23:10 ` [PATCH bpf-next v10 0/4] BPF crypto API framework patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54ff0e5d-1089-4370-913a-d4fdf2fd8ad1@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=vadfed@meta.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).