Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4621985pxb; Mon, 27 Sep 2021 23:27:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXpNF7UMf8RpE8TrTDa5xs5l1ZTInOaT26sIXEA7xcGYncEMOB+AKNNSmLO6/UL6t74JQ5 X-Received: by 2002:a17:90a:b288:: with SMTP id c8mr3571045pjr.67.1632810446011; Mon, 27 Sep 2021 23:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632810446; cv=none; d=google.com; s=arc-20160816; b=EZr6uxQHP6Osw6Sh9oV3WInBEykGwTI/pmP3OjDCm026za2/8jWkKYzbAvr/GnW/dW sngA/i+s9IWoCM0PuPC4BWWtVcWPICqefPIe28bmMixXWuiKBjFP5xY8bSCj2ORJP91b ho29p2R6ZjIhO3et8AQb5RzPct+keYeOqp1ERwCRwB2nhm0GlLVyeUqaj2m7u0YPzfPB CL0otFXESRgJE9ZxeKtAbjrR6ofyejzF1amJQz03bT+Zw7z3IOvkUkhkpJlPzLOnrFO/ 6CEeAzVKkXy2uWj2W1KX1Bm4sJPzghyqSYc7fegOBtivbsceioW+fwkeE1PERqTkfhMC f3yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jeHc5//bjoC21tgm5ld61+UV5p434iqnXQqCdikGuIY=; b=ijK2Zp/RUvRaZfU34Jd0kPap2jN2dIuN/24JqVIbYD9bUlFcP0Ovo9gLJdx2vUftUr Y9oKhFoEtZB6kiTyGARlD35DsH1SoQ1sbkH6TjnwjaqxoNhu98U9u9Y4RXuHgKzO03LT EVb3zvn1I7CuBJB//8YORmusj8LGdWSu0HMvcMpnIH2vuTdQCSXJrw+qP/IzbGOk8luL kvi1E7gU0xDd5koiYqMmU13YjuihWkA7xwTDq5g9Xc60GoLsHAbjqWGwjBu2Vp2rm+cA sbd39U+3CUi1cHuThwdjufCmLyh0GDYB4y6/w03HyFDGjuKoe+BHgkXpzRrx77X4yEQx yxAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jo3iPuwk; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si23522832plo.8.2021.09.27.23.27.12; Mon, 27 Sep 2021 23:27:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jo3iPuwk; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234890AbhI1G2s (ORCPT + 99 others); Tue, 28 Sep 2021 02:28:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:60846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234207AbhI1G2s (ORCPT ); Tue, 28 Sep 2021 02:28:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 309B5611BD; Tue, 28 Sep 2021 06:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632810429; bh=gGSfvzOmjzE3uTefL139gVbIvttn9yn4r5LhiGbvw/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jo3iPuwkTOeimGBgEgOu8dd17zrY7ubjaXar4ncU7iWGiXBIJItkqjmkeqmxuo5Qw GDGoPQG4TOEzGzaXtGs5W8eugUfsDMwBaxjRg/XitBV3DcorMjkZEW+2Tz36EvyRFe HMjlVawtRWZwurFLvveKPWUyvG3vE4pnjA1L45lr0YS2IkV6vbHgry3FLvPe6ISIpc /9G4l3wWtgodeRBdOjc5v7Y3aR6FC/gErEZ68BV+oiW2m6QTRgERJ+cVeiUjoWNXzO l09Fx5FOgKWr4CBqROaVFgmXE0MzYU8TPviVVqLUtiNBjYIrHu36jVkl7p20oyBAzp CgvW/Ch/zpydg== Date: Mon, 27 Sep 2021 23:27:07 -0700 From: Eric Biggers To: XiaokangQian Cc: Herbert Xu , "David S. Miller" , Catalin Marinas , Will Deacon , nd@arm.com, ardb@kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: arm64/gcm-ce - unroll factors to 4-way interleave of aes and ghash Message-ID: References: <20210923063027.166247-1-xiaokang.qian@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210923063027.166247-1-xiaokang.qian@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Sep 23, 2021 at 06:30:25AM +0000, XiaokangQian wrote: > To improve performance on cores with deep piplines such as A72,N1, > implement gcm(aes) using a 4-way interleave of aes and ghash (totally > 8 blocks in parallel), which can make full utilize of pipelines rather > than the 4-way interleave we used currently. It can gain about 20% for > big data sizes such that 8k. > > This is a complete new version of the GCM part of the combined GCM/GHASH > driver, it will co-exist with the old driver, only serve for big data > sizes. Instead of interleaving four invocations of AES where each chunk > of 64 bytes is encrypted first and then ghashed, the new version uses a > more coarse grained approach where a chunk of 64 bytes is encrypted and > at the same time, one chunk of 64 bytes is ghashed (or ghashed and > decrypted in the converse case). > > The table below compares the performance of the old driver and the new > one on various micro-architectures and running in various modes with > various data sizes. > > | AES-128 | AES-192 | AES-256 | > #bytes | 1024 | 1420 | 8k | 1024 | 1420 | 8k | 1024 | 1420 | 8k | > -------+------+------+-----+------+------+-----+------+------+-----+ > A72 | 5.5% | 12% | 25% | 2.2% | 9.5%| 23%| -1% | 6.7%| 19% | > A57 |-0.5% | 9.3%| 32% | -3% | 6.3%| 26%| -6% | 3.3%| 21% | > N1 | 0.4% | 7.6%|24.5%| -2% | 5% | 22%| -4% | 2.7%| 20% | > > Signed-off-by: XiaokangQian Does this pass the self-tests, including the fuzz tests which are enabled by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y? - Eric