netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Vadim Fedorenko <vadfed@meta.com>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Jakub Kicinski <kuba@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	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 v9 4/4] selftests: bpf: crypto: add benchmark for crypto functions
Date: Fri, 19 Apr 2024 12:31:38 +0100	[thread overview]
Message-ID: <20240419113138.GV3975545@kernel.org> (raw)
In-Reply-To: <20240416204004.3942393-5-vadfed@meta.com>

On Tue, Apr 16, 2024 at 01:40:04PM -0700, Vadim Fedorenko wrote:
> Some simple benchmarks are added to understand the baseline of
> performance.
> 
> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>

...

> 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..86048f02e6ac
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/benchs/bench_bpf_crypto.c
> @@ -0,0 +1,190 @@
> +// 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"
> +#include "../progs/crypto_share.h"
> +
> +#define MAX_CIPHER_LEN 32
> +static char *input;
> +static struct crypto_ctx {
> +	struct crypto_bench *skel;
> +	int pfd;
> +} ctx;
> +
> +static struct crypto_args {
> +	u32 crypto_len;
> +	char *crypto_cipher;
> +} args = {
> +	.crypto_len = 16,
> +	.crypto_cipher = "ecb(aes)",
> +};
> +
> +enum {
> +	ARG_CRYPTO_LEN = 5000,
> +	ARG_CRYPTO_CIPHER = 5001,
> +};
> +
> +static const struct argp_option opts[] = {
> +	{ "crypto-len", ARG_CRYPTO_LEN, "CRYPTO_LEN", 0,
> +	  "Set the length of crypto buffer" },
> +	{ "crypto-cipher", ARG_CRYPTO_CIPHER, "CRYPTO_CIPHER", 0,
> +	  "Set the cipher to use (defaul:ecb(aes))" },

nit: should this be 'default' ?

Flagged by checkpatch.pl --codespell

> +	{},
> +};

...

  reply	other threads:[~2024-04-19 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 20:40 [PATCH bpf-next v9 0/4] BPF crypto API framework Vadim Fedorenko
2024-04-16 20:40 ` [PATCH bpf-next v9 1/4] bpf: make common crypto API for TC/XDP programs Vadim Fedorenko
2024-04-17  6:17   ` kernel test robot
2024-04-19 18:57   ` Martin KaFai Lau
2024-04-20  0:24     ` Vadim Fedorenko
2024-04-22 21:42       ` Martin KaFai Lau
2024-04-16 20:40 ` [PATCH bpf-next v9 2/4] bpf: crypto: add skcipher to bpf crypto Vadim Fedorenko
2024-04-16 20:40 ` [PATCH bpf-next v9 3/4] selftests: bpf: crypto skcipher algo selftests Vadim Fedorenko
2024-04-19 21:38   ` Martin KaFai Lau
2024-04-20  0:56     ` Vadim Fedorenko
2024-04-16 20:40 ` [PATCH bpf-next v9 4/4] selftests: bpf: crypto: add benchmark for crypto functions Vadim Fedorenko
2024-04-19 11:31   ` Simon Horman [this message]
2024-04-19 22:02   ` Martin KaFai Lau

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=20240419113138.GV3975545@kernel.org \
    --to=horms@kernel.org \
    --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=martin.lau@linux.dev \
    --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).