lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <caa03909-267e-4f57-8e61-d64d20dbd305@linux.dev>
Date: Thu, 25 Apr 2024 00:00:11 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Martin KaFai Lau <martin.lau@...ux.dev>, Vadim Fedorenko <vadfed@...a.com>
Cc: Jakub Kicinski <kuba@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
 Alexei Starovoitov <ast@...nel.org>, Mykola Lysenko <mykolal@...com>,
 Herbert Xu <herbert@...dor.apana.org.au>, netdev@...r.kernel.org,
 linux-crypto@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next v10 4/4] selftests: bpf: crypto: add benchmark
 for crypto functions

On 24/04/2024 23:43, Martin KaFai Lau wrote:
> 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.
> 

Got it. Will do re-spin then...

>> +{
>> +    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;
>> +}
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ