Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp735316lqd; Wed, 24 Apr 2024 15:43:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNI8UUHYM3J4884EhLKhyNnRm6Zw4shgQwJLs3/OYP4ouxz7Fs1tBp1H02YqKhKDrfzUCh04HxY2eihBEzIu+k5nJ78XM4Fn/cy59f+w== X-Google-Smtp-Source: AGHT+IHa/+ctnSW21kpv8XY1ROsu7QkJFcV83J1Nl9Hd4FkMwsmfToepJRgdRxVU+sJI5y344qCR X-Received: by 2002:a05:6214:a68:b0:69b:fb9:9a75 with SMTP id ef8-20020a0562140a6800b0069b0fb99a75mr3917573qvb.49.1713998596786; Wed, 24 Apr 2024 15:43:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713998596; cv=pass; d=google.com; s=arc-20160816; b=rTFWrIeWiZKPIsdgJ+QGHJEa67egvbRNZN8uZiw7lydKD59la2hRihza8MDP2DiRew 84sax2Yga7Au+0efjlsgfIC7W0EghiNxuwRzH65+IGcuviyCOi+HIuFInxSTWPjRzheZ V+39QP/Edj/GnqSmzNP9xHbVsMj2MCDeidn/AK9nzMA2xjCMLO7N3ypkzSvjHLzZLJ3a ZE7+/Eg4BLK7gdG2eT4woRssH6VzlD7ozMnUrGlBu3huO5+tNoiIflm+4lDXERIE/xdb wh1NLGsxK87R5RGlMSMIUfbzPvAkrqdYyh4VILrGHrGkXWEpKOBhYQBL2QOXapMcIQ8x /vEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=e/InxbHrRpw2QBg/mB3CHlp5dXRfQxr9b0B/XEmYf3I=; fh=adDEKz+LGqreWP8JS43KZ013Rwc+LlwvF81fRRM90Hs=; b=b0wdqbMkeUm6FYew3JhuaXpQzuxRn/fnILInSGFVVdZRDiO6oU7X5IoTJbLrRHb7fR d1/1w6XbxWDKDq17zdelSdSoUoKt8fWjr2cv6N+N838luatIteTLAcvR5uLaoIILvvRf 1Qrofsc352H0AKUtCNexj/M7pL2eUdHVqJdyc7VAGszSNkbVbWfbZWeScL+Bpa6EL9xJ iXdss/TB/PjX4QtTN3Z1utm0alChgslAciXb4LPuGg5e7h471T2les+yRgiXYPZGsfBH RqUjqScTKsBh0p/7kQSPisC01lMQtudRGYWf9hCLhToEvIGp+l78gvE4kuuNAlgm9qPi JTqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d+EDqjrR; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-crypto+bounces-3833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gm7-20020a056214268700b0069b503c131esi16208096qvb.314.2024.04.24.15.43.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 15:43:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d+EDqjrR; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-crypto+bounces-3833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EEDE51C21413 for ; Wed, 24 Apr 2024 22:43:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADE5316E873; Wed, 24 Apr 2024 22:43:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="d+EDqjrR" X-Original-To: linux-crypto@vger.kernel.org Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C069E16E861 for ; Wed, 24 Apr 2024 22:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713998591; cv=none; b=QiG/JUhHS5WONJybNemQD8fDMujZmcIstO8ytsxTDxUd73vQ5FHbb3sMZUel7xBL3Wu6mhjVIV7VzpXizTT/lylZZSIRr4ST7zNs84nEr5RWJv8bbHdMuaSthp6WCCRY6TFmrBk+QqdZRaFY4fQ+EcMDBQgY0VA8lX/5m8QqIkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713998591; c=relaxed/simple; bh=M23gJzNUTmMvVNaqhzxa8gBavIGbqQgeIsGN9gbvjeQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kqbSHoW4CP6xcTZ+LysTchIPgOiLFfdakfvJAT2pBCQhMfpKvg27kAXJF1ATCSVQQdx099MDF7UFeFGO2+PZhH/gAUkHvqgQUylTIy8qR+uHdhm0yUux9MR30VEWGSY5ImWyodTaJY3GbXHEzZ3zThPQV2iwZqa/H63DSwfbb+0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=d+EDqjrR; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <54ff0e5d-1089-4370-913a-d4fdf2fd8ad1@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713998588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e/InxbHrRpw2QBg/mB3CHlp5dXRfQxr9b0B/XEmYf3I=; b=d+EDqjrRvi1/ELoNF5vFetZGs3SWhHFzsNfrsZRpU5caAfxx6vYzLLjBdGXCr3TwHtG7+c 7u4w/mG6NyQxqGKdGxNz7KJQPVTKn8pnhiz0+JQ0BfULWKQHVlPuSrpDholfPtSGellh9K ehVMURlLkpelxYvEpmJ074bpDsDC7PE= Date: Wed, 24 Apr 2024 15:43:02 -0700 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v10 4/4] selftests: bpf: crypto: add benchmark for crypto functions To: Vadim Fedorenko Cc: Vadim Fedorenko , Jakub Kicinski , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , Herbert Xu , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org References: <20240422225024.2847039-1-vadfed@meta.com> <20240422225024.2847039-5-vadfed@meta.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau Content-Language: en-US In-Reply-To: <20240422225024.2847039-5-vadfed@meta.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT 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 > +#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; > +}