From patchwork Tue Oct 3 23:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 9983623 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE41A6029B for ; Tue, 3 Oct 2017 23:00:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4D6628A2A for ; Tue, 3 Oct 2017 23:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A330128A41; Tue, 3 Oct 2017 23:00:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4855828A44 for ; Tue, 3 Oct 2017 23:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbdJCXAY (ORCPT ); Tue, 3 Oct 2017 19:00:24 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34917 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbdJCXAX (ORCPT ); Tue, 3 Oct 2017 19:00:23 -0400 Received: by mail-wr0-f196.google.com with SMTP id y44so1822403wry.2 for ; Tue, 03 Oct 2017 16:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=BhlIa3RZQkU2h/ckWFqqqZqyWEcKU4BDGwo3cp+8eqc=; b=r8zRoy64LAnd7szztNkeFa7dokMh3LXSZTP7LaDJvS60Ua5cS6kYDDSI5WubTZ7cSM 0gPYroOtF7FYQm047mIytpRNxDKv88fAelUyi9/2DqcUKbN+e2cgUUFfyGxDxF1EUe4K cR1dJIvVPO+XPjtJjSLpBZ03dLPupVVqkxBXJph9M7ZnBEKYntzBkpW9gPhXgTjPvBKc TWvz+dlClgHlClZ/n6YgzJ7Oqj2hLBNslRzegYH2io8UXkgqjKDgdpf/TVzoouZNXKVY WhmKviXuJhy2oBZr/7snaMwGlNGJSm+NeQ/j7/E2hFkMXchIjWIPbI0t73F5EVJfH5dO Hvdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=BhlIa3RZQkU2h/ckWFqqqZqyWEcKU4BDGwo3cp+8eqc=; b=C5vazrBTUWtaXjnUDexqCc3Qrm8UdQPw7o6TanhDIIoJNriiA8wAPf4BViv5lhrJCg IpwFPMRitn0BrcijjZB+fCqtK8UYGt8VFgciZf3v+EdDox5j4qMkOyCaJqS63BFI3zI0 6Pmklg+MBvai86Jl5rHhaMZat71/6TGKhmjjHyBDHugl1HpEc/Y2Rzi3T+YUva3+iUap 0SNrNYzcT4rR6DRuCzk8I6Nma1NlKlJRbV90XI8aWNCZwXsZf7KU7UXOZeD3XPDBSwUa 2ZvXpQOkwQv4u0FGvjpEHD6+gBNQ7nu56xKGKHLEZKM1h6HIObBEqAXE3N4nK7s09pFq sLaA== X-Gm-Message-State: AHPjjUiV1GTXx+6CE6QatFa8VTBOU4dD9bTlmbHD3NtH8Ufbezo9XCFu OHduQRPFhvs7pbK2kATBHmdliBkd X-Google-Smtp-Source: AOwi7QCIx5PqV1nI/TXWDiWf5GcVNwaXB/h48uAtx82yxUl/fSBff/cdnMuQ5ourCtId9sXUB3R37g== X-Received: by 10.223.132.101 with SMTP id 92mr18428244wrf.85.1507071621624; Tue, 03 Oct 2017 16:00:21 -0700 (PDT) Received: from debian64.daheim (p200300D5FBCA48FCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbca:48fc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id u18sm1002190wrg.94.2017.10.03.16.00.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 16:00:19 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1dzWAj-00010H-Gr; Wed, 04 Oct 2017 01:00:17 +0200 From: Christian Lamparter To: linux-crypto@vger.kernel.org Cc: Herbert Xu Subject: [PATCH 04/13] crypto: crypto4xx: increase context and scatter ring buffer elements Date: Wed, 4 Oct 2017 01:00:08 +0200 Message-Id: <81f5ee6cd79bd9ac319ace2cd7d778336b01b2d2.1507070985.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> References: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> In-Reply-To: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> References: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If crypto4xx is used in conjunction with dm-crypt, the available ring buffer elements are not enough to handle the load properly. On an aes-cbc-essiv:sha256 encrypted swap partition the read performance is abyssal: (tested with hdparm -t) /dev/mapper/swap_crypt: Timing buffered disk reads: 14 MB in 3.68 seconds = 3.81 MB/sec The patch increases both PPC4XX_NUM_SD and PPC4XX_NUM_PD to 256. This improves the performance considerably: /dev/mapper/swap_crypt: Timing buffered disk reads: 104 MB in 3.03 seconds = 34.31 MB/sec Furthermore, PPC4XX_LAST_SD, PPC4XX_LAST_GD and PPC4XX_LAST_PD can be easily calculated from their respective PPC4XX_NUM_* constant. Signed-off-by: Christian Lamparter --- drivers/crypto/amcc/crypto4xx_core.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h index 97fb8288ab30..27e439c1f5bf 100644 --- a/drivers/crypto/amcc/crypto4xx_core.h +++ b/drivers/crypto/amcc/crypto4xx_core.h @@ -36,12 +36,12 @@ #define PPC405EX_CE_RESET 0x00000008 #define CRYPTO4XX_CRYPTO_PRIORITY 300 -#define PPC4XX_LAST_PD 63 -#define PPC4XX_NUM_PD 64 -#define PPC4XX_LAST_GD 1023 +#define PPC4XX_NUM_PD 256 +#define PPC4XX_LAST_PD (PPC4XX_NUM_PD - 1) #define PPC4XX_NUM_GD 1024 -#define PPC4XX_LAST_SD 63 -#define PPC4XX_NUM_SD 64 +#define PPC4XX_LAST_GD (PPC4XX_NUM_GD - 1) +#define PPC4XX_NUM_SD 256 +#define PPC4XX_LAST_SD (PPC4XX_NUM_SD - 1) #define PPC4XX_SD_BUFFER_SIZE 2048 #define PD_ENTRY_INUSE 1