Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp568663lqt; Fri, 19 Apr 2024 04:32:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV07zsCbXzVUslHPUmaa5ex3pXNuPFJKCcZHCW7MTpiletB6NYUyg4ns17b/cQt7DXf88otjLMirWmR6d0vCwE2swDqNMOTn7xDpSUw9w== X-Google-Smtp-Source: AGHT+IG/k6Th+eu2H+XYyW2gY6F7nrgLhhkkpyoCz+lrfP+5Wm8eEu0HjFN/8IRFYzzLOGTpPQgI X-Received: by 2002:a17:907:1c24:b0:a52:3d1:6715 with SMTP id nc36-20020a1709071c2400b00a5203d16715mr1398775ejc.68.1713526341729; Fri, 19 Apr 2024 04:32:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713526341; cv=pass; d=google.com; s=arc-20160816; b=U/jat0mHnNhu1/M8n5k174/cMMeBGPShczMedXKZo10Y6D5sZ774oh1KjyJbJjC/ha FltAJCKJnEWuUBEDkIrv2M3cCWPgEmuR20rbFF0Wo0s2civQw6JpcpxGqEkSc7Dujhnm W6/4rXKcE5U70jV2Kg6hhJeOnyxgOoJ2Zfvjj34NBIdEUXu9ZGZTj+bBtLRDXh97rCQT Sh/6zv8uq0/jalMX4FHJ0MIFtbQ3N6nMxCjUR09fMXXpGsFVllIAEiW1/0ea4s5SvKUD pm2fTkisL78snEEzwZbOugb32KhekwCTr8//joAk4rtxnAhI0jMnSrUPfl9NVssYZM5r +MkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gAQvNV1G3crULl9465QVmMXg3hB275YwHr9VbQQN79M=; fh=si41yM2HnWiDcuNg8S1DoMrzup3eAh/M34JJTbly2PM=; b=F0V8Xqf9pKou3aS3oU7HgIKG0fGiWZl3EfTDAyZMnrqGHql+Z3sLRvwDusSEkRa9Uq gPK+f4aV3Gtenj4ZHlwNsx9M31fzoUWfuMalWsNRj6RR2D1FTVGlxScyTyYTl79n/J9W cMNzaKUXiHRE4rk6F0YfCdIoh7oFSpoTTS/AzbMnnYCjztMF4dNRChMNYVLXHfGFgIl+ Bk38TOt0KdAY4zcaNoTGRN4pS7suze8LJhMnZxb0177WCd0kB0LPBrurndP2smcclewm nVw9UknkCxd02cqUxduN1qxah8afjIkEG8+2ZciCuTNZSosK8DCcWfwt6whWNZbMpivt ezKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dI9pphsJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id us8-20020a170906bfc800b00a51902ba103si1902384ejb.534.2024.04.19.04.32.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 04:32:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dI9pphsJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 749311F216F0 for ; Fri, 19 Apr 2024 11:32:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 095DC823AF; Fri, 19 Apr 2024 11:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dI9pphsJ" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B66291F5F5; Fri, 19 Apr 2024 11:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713526305; cv=none; b=vFTZ0vW4a3pgnogwUXyXh03oZrtdYJBGDP3s1HI6y3jHmILl9swrujdy7h1xB0gqwa7QmPgfgCpqK6Jp1mByBB9slIRFEZlWCJna3VQoI+SpxjhK+sfEurDGrg5jv45zaD/ur48bjbNeX0W1AUDg7tKY9fRXl51ioYUBU3inJYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713526305; c=relaxed/simple; bh=E8GQZ30IgEfs2553uTgpC3VI6FZP4BY+8jCXkE4DTL0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nlhG5j0SO9QbWg0AZTjN9zFvYCyGiq4n5Xsv0VDIC6iDyi3N1p0X66icob0c7YDrHh376dZrVuqafiCXUXr6Z0YceX8xvUM0R3vBvapQitaTcfHbzC0iG5YDMC6Yrf4Cwk9OAW6zkuCJ/8cdx76fpLQZ3oxsrj4xj59e9ZXv70E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dI9pphsJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBFB3C072AA; Fri, 19 Apr 2024 11:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713526303; bh=E8GQZ30IgEfs2553uTgpC3VI6FZP4BY+8jCXkE4DTL0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dI9pphsJgUI3ZaPbzwPgArztc1emHtKBW27UPNklZXQCi320J7nX0+x2uz4/+ofxt dzf2Ni1LmysBiKgK2MqM6uMf7IR7rsuGSoWGmTTDVhmiTGdOj1uhvVrHr7HA0Ye/2z ynYo1ppTvPGL4nS+Ef2RzSpwwA3S8E1ZBcyc1Aemqhsej+YBOq/5+hZwCSssQo6IVP Pixc3RFFZwID9PiElgBpHHgFXR66dbGh+EFsrf2rV8zVI3YsPkgYykemIZ3Yxbjk8O Wu1v/PxnnNg8kFMa00eTq6MByd0pXKV2qMT8tgwQWMpbPqBfx+mY913LyMmojYMaoE 3ESGxZCvurS3g== Date: Fri, 19 Apr 2024 12:31:38 +0100 From: Simon Horman To: Vadim Fedorenko Cc: Vadim Fedorenko , Jakub Kicinski , Martin KaFai Lau , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , Herbert Xu , 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 Message-ID: <20240419113138.GV3975545@kernel.org> References: <20240416204004.3942393-1-vadfed@meta.com> <20240416204004.3942393-5-vadfed@meta.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 ... > 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 > +#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 > + {}, > +}; ...