From patchwork Sun Dec 17 08:29:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 122174 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1514613qgn; Sun, 17 Dec 2017 00:30:15 -0800 (PST) X-Google-Smtp-Source: ACJfBotPYkZfT7keT+/0WoIDam0OD2UHM+obBT5jl7ZaHBtWh1r3vUODq/2q+YlX4IOzI2vrTf8N X-Received: by 10.159.196.130 with SMTP id c2mr19056163plo.123.1513499415090; Sun, 17 Dec 2017 00:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513499415; cv=none; d=google.com; s=arc-20160816; b=PFAi2/eIsFazAgE7Z1eo1jC8+EnEgq6W0kS6LaQ5rHIgVZimWxoBkvfUXH6xha57YW qQ+Ylx0KER+IsAkRDGxihH8wTzcTL1zf8PlTEhGO8rlz5lvuS9YmCXu4dLy5LfqONTXB aP9n+uhYHCXuUf1DIMQR5btVtvcL0NjRr2y7ShS5sC0alJb1V3FXRdJI/66YrzEsiYiI X+KbFjSiBWVwrjlR0iuj2D4LUvELX8p5NKDICGH5x5fOq+mknKx7trTQrVD4rsSasIdS 0fkvdL/QCT1idR9D7TYmQibKuXSlgCxu2W5eSwV28HWc7sMnbAbjh5/cb1TMhpRdbFaE zHIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=fdofa9jNHUZDonqBeoFqTgPeaMX0UqIhrz+wF3jQCo8=; b=cUHrFfVHrinX9XgXDhpEnKrOyfEsPjuZZ6cQWeWghUk3noCFy6AcFH73gbSrAfPXHK X8nMmt38SSMZ3/+t1UtE08ahu6pGswMAP3lHPvk5vdHbs1oIOyN8IpxxWfh68kSZpzRI 6eKVfTCqpj0dYrZkJfNTpyqsK9gsDi9QSrtVbb/fqYJxq/JgiDLSzh4a6W7ieu8IdY4b JokSqWBLINYWGTPwYWDz1nxatXuS6mgzMhNugcFp9PhhjU9rpef3y093e+Ss2Eh+qs06 IcsbhV3XU7ye548BJnc5ED8jlY+tBvSPTR+slaBTNFjWnAG5fK6arcTFr3HkuKZgD1wQ lcYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si7550038plp.574.2017.12.17.00.30.14; Sun, 17 Dec 2017 00:30:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752395AbdLQIaM (ORCPT + 1 other); Sun, 17 Dec 2017 03:30:12 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:40906 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbdLQIaF (ORCPT ); Sun, 17 Dec 2017 03:30:05 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 869E61596; Sun, 17 Dec 2017 00:30:04 -0800 (PST) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B4743F24A; Sun, 17 Dec 2017 00:30:02 -0800 (PST) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] crypto: tcrypt: use multi buf for ahash mb test Date: Sun, 17 Dec 2017 08:29:00 +0000 Message-Id: <1513499346-9047-2-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513499346-9047-1-git-send-email-gilad@benyossef.com> References: <1513499346-9047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The multi buffer ahash speed test was allocating multiple buffers for use with the multiple outstanding requests it was starting but never actually using them (except to free them), instead using a different single statically allocated buffer for all requests. Fix this by actually using the allocated buffers for the test. It is noted that it may seem tempting to instead remove the allocation and free of the multiple buffers and leave things as they are since this is a hash test where the input is read only. However, after consideration I believe that multiple buffers better reflect real life scenario with regard to data cache and TLB behaviours etc. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 28b4882..a0c4e0d 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -385,7 +385,7 @@ static inline int do_one_ahash_op(struct ahash_request *req, int ret) } struct test_mb_ahash_data { - struct scatterlist sg[TVMEMSIZE]; + struct scatterlist sg[XBUFSIZE]; char result[64]; struct ahash_request *req; struct crypto_wait wait; @@ -428,7 +428,12 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ahash_request_set_callback(data[i].req, 0, crypto_req_done, &data[i].wait); - test_hash_sg_init(data[i].sg); + + sg_init_table(data[i].sg, XBUFSIZE); + for (j = 0; j < XBUFSIZE; j++) { + sg_set_buf(data[i].sg + j, data[i].xbuf[j], PAGE_SIZE); + memset(data[i].xbuf[j], 0xff, PAGE_SIZE); + } } pr_info("\ntesting speed of multibuffer %s (%s)\n", algo, @@ -439,9 +444,9 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, if (speed[i].blen != speed[i].plen) continue; - if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) { + if (speed[i].blen > XBUFSIZE * PAGE_SIZE) { pr_err("template (%u) too big for tvmem (%lu)\n", - speed[i].blen, TVMEMSIZE * PAGE_SIZE); + speed[i].blen, XBUFSIZE * PAGE_SIZE); goto out; } From patchwork Sun Dec 17 08:29:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 122175 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1514623qgn; Sun, 17 Dec 2017 00:30:16 -0800 (PST) X-Google-Smtp-Source: ACJfBotG9N5mD1hQRmPPHlo4GEUfylXK3Yt48zYFD+mka4QXCMTolmImSOxH2FI/RuO04xo3bKoa X-Received: by 10.84.149.102 with SMTP id b35mr14384792plh.240.1513499416527; Sun, 17 Dec 2017 00:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513499416; cv=none; d=google.com; s=arc-20160816; b=Hq6neC6Sweckcl14daFjYqqRDmZKUrSZlOVMPPbyh29zJtZwL64ihZttZTJTRqGc1Q 7HHudNejdHC/ZWDY1JDlDwClK+jcYGqcemfPpF0px+nrs6/ae9ykZscRqJsiP559TRwr hZo7qopTUs9mFR4iDh66nGIWemicrQ+UUqmzMaSiFzdN21aY2LL7lIg+mEWiCSBU2sSV ea8gf7YUsXznApUJif88fR9Qau5yVmK/7CCFWCVSxdr4x3xtKrSl6dTdgLL6YH5v8nCI zLQFpVOlLGUcWCyskKojGfqyYDiC8FObDtuVtikwtNiCFyheb3yAM/V5x5ABIkfD6LYa cRKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=L8KjKlO1ZfH+ivRDQaBMbef9fN+P6ooeJ4Rmom6/Tlk=; b=TP17bgb83q9pfv0s+NGAo7e9vjm1m8sWRu5Y7jU28dFOPgok0+IK3oxz5cIyEjZVdZ GQmEm7FBT4OMLLXieDY7MmCf+Ju4m8TNVlsNiMkVEPO+mDu0Z7toSps846RbsSMN2QMM HjTAMT+HbX6HbjxiuUMWbJOkoIqCwNJXFEo91fDkHnNkDDOSL8wUSqcV4fl4r3X/vSRS aMV6kkO2e8ahzNgwidtEHQHOIAIJHp64X1U8Wd1ja6WNSjIFIfkjO9tK330r4/kHjivs WdBIQjH5BPu4PucQBkZrraFueJZf6XHW2DB81jBRu3E86mgPWTxUcq6H8o14YdtUW41h xu0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si7550038plp.574.2017.12.17.00.30.16; Sun, 17 Dec 2017 00:30:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751650AbdLQIaN (ORCPT + 1 other); Sun, 17 Dec 2017 03:30:13 -0500 Received: from foss.arm.com ([217.140.101.70]:40914 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005AbdLQIaI (ORCPT ); Sun, 17 Dec 2017 03:30:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2963D1435; Sun, 17 Dec 2017 00:30:08 -0800 (PST) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 56C793F24A; Sun, 17 Dec 2017 00:30:06 -0800 (PST) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] crypto: tcrypt: fix AEAD decryption speed test Date: Sun, 17 Dec 2017 08:29:01 +0000 Message-Id: <1513499346-9047-3-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513499346-9047-1-git-send-email-gilad@benyossef.com> References: <1513499346-9047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The AEAD speed test pretended to support decryption, however that support was broken as decryption requires a valid auth field which the test did not provide. Fix this by running the encryption path once with inout/output sgls switched to calculate the auth field prior to performing decryption speed tests. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index a0c4e0d..69c8e63 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -329,10 +329,30 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs, *b_size + (enc ? authsize : 0), assoc, aad_size); + aead_request_set_ad(req, aad_size); + + if (!enc) { + + /* + * For decryption we need a proper auth so + * we do the encryption path once with buffers + * reversed (input <-> output) to calculate it + */ + aead_request_set_crypt(req, sgout, sg, + *b_size, iv); + ret = do_one_aead_op(req, + crypto_aead_encrypt(req)); + + if (ret) { + pr_err("calculating auth failed failed (%d)\n", + ret); + break; + } + } + aead_request_set_crypt(req, sg, sgout, *b_size + (enc ? 0 : authsize), iv); - aead_request_set_ad(req, aad_size); if (secs) ret = test_aead_jiffies(req, enc, *b_size, @@ -1566,16 +1586,24 @@ static int do_test(const char *alg, u32 type, u32 mask, int m) NULL, 0, 16, 16, aead_speed_template_20); test_aead_speed("gcm(aes)", ENCRYPT, sec, NULL, 0, 16, 8, speed_template_16_24_32); + test_aead_speed("rfc4106(gcm(aes))", DECRYPT, sec, + NULL, 0, 16, 16, aead_speed_template_20); + test_aead_speed("gcm(aes)", DECRYPT, sec, + NULL, 0, 16, 8, speed_template_16_24_32); break; case 212: test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec, NULL, 0, 16, 16, aead_speed_template_19); + test_aead_speed("rfc4309(ccm(aes))", DECRYPT, sec, + NULL, 0, 16, 16, aead_speed_template_19); break; case 213: test_aead_speed("rfc7539esp(chacha20,poly1305)", ENCRYPT, sec, NULL, 0, 16, 8, aead_speed_template_36); + test_aead_speed("rfc7539esp(chacha20,poly1305)", DECRYPT, sec, + NULL, 0, 16, 8, aead_speed_template_36); break; case 214: From patchwork Sun Dec 17 08:29:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 122179 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1515510qgn; Sun, 17 Dec 2017 00:31:24 -0800 (PST) X-Google-Smtp-Source: ACJfBosCoIXj1bLKFNSTtblUg07kfBH3dV/mIM6mrCp3xt+53G+abhlOpeWKPC2vj7jgFJGy37Y3 X-Received: by 10.84.233.1 with SMTP id j1mr19128142plk.311.1513499483951; Sun, 17 Dec 2017 00:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513499483; cv=none; d=google.com; s=arc-20160816; b=tIpW3WJmYIz42+qBYBoRnDgEzMFdD031C/QPZypAMvPSHMdHVAUswY+DWeXhS+11o0 +TQfYJUTuJgcgGJpGfp514rmwAkLjWCLbUMWS8WkBS1rq6b7crY7fz8vyckV4Vd83Oy9 iTlNtUe6rqTiYlRVKThiTU7OesS8tBqb6weqSMKlUBgif9YTNjOjE5cxMvxvSy29AWO/ XSdxm+id1UyvLL6VIjUPpwZW9SjR953Ql0NVjj5/X0QIdYO6DxEV/hnotHkzhvDHBK96 QJ5elDQez7+v18R9CzLsHSIWJ06xOVJK6mN9sq3ebD+V9ys4qk3Okol/05J9IHjk++tc wCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=lt4qlT+xff90iS9HpYNHEDP+JtdsHMCogb8Bu2qv5/s=; b=eV9SPR9CJz8nALI8Zw49cfcXS+UhEK0xt2bLyKAbbpqUS7jcWCWoPne8XFJkgqvNPD OlfWcYibO5kEQs7CUhxiKSZZoS8yw/xE/tXP7RB4W8JeOabsiEwZsbBEhnOQvCYH8CjV L4mxC2gTs5a53OjTjnxTMqqE4QoqMzmJJyruaDdjJCuMm5h/RdJznZ+G5XNz5uO2bB0u lhkIye+8MbUNvfdMyrBOnYj2xrWcN/1FuUEDsoWIOERRxoZhoeiZ/9txssD5HPSklySx b1qwseb8VTjAOAoTY1vdqrdTCEqaEyeU2CpIKp8+Dxknmsngf52JwEX16j8UdHa/cBje +urg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si7908121pln.774.2017.12.17.00.31.23; Sun, 17 Dec 2017 00:31:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752245AbdLQIbW (ORCPT + 1 other); Sun, 17 Dec 2017 03:31:22 -0500 Received: from foss.arm.com ([217.140.101.70]:40920 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752382AbdLQIaL (ORCPT ); Sun, 17 Dec 2017 03:30:11 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8337A1435; Sun, 17 Dec 2017 00:30:11 -0800 (PST) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 82C213F24A; Sun, 17 Dec 2017 00:30:09 -0800 (PST) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] crypto: tcrypt: allow setting num of bufs Date: Sun, 17 Dec 2017 08:29:02 +0000 Message-Id: <1513499346-9047-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513499346-9047-1-git-send-email-gilad@benyossef.com> References: <1513499346-9047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org For multiple buffers speed tests, the number of buffers, or requests, used actually sets the level of parallelism a tfm provider may utilize to hide latency. The existing number (of 8) is good for some software based providers but not enough for many HW providers with deep FIFOs. Add a module parameter that allows setting the number of multiple buffers/requests used, leaving the default at 8. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 69c8e63..2604360 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -67,6 +67,7 @@ static char *alg = NULL; static u32 type; static u32 mask; static int mode; +static u32 num_mb = 8; static char *tvmem[TVMEMSIZE]; static char *check[] = { @@ -413,7 +414,7 @@ struct test_mb_ahash_data { }; static void test_mb_ahash_speed(const char *algo, unsigned int sec, - struct hash_speed *speed) + struct hash_speed *speed, u32 num_mb) { struct test_mb_ahash_data *data; struct crypto_ahash *tfm; @@ -422,7 +423,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, unsigned int i, j, k; int ret; - data = kzalloc(sizeof(*data) * 8, GFP_KERNEL); + data = kcalloc(num_mb, sizeof(*data), GFP_KERNEL); if (!data) return; @@ -433,7 +434,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, goto free_data; } - for (i = 0; i < 8; ++i) { + for (i = 0; i < num_mb; ++i) { if (testmgr_alloc_buf(data[i].xbuf)) goto out; @@ -473,7 +474,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, if (speed[i].klen) crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen); - for (k = 0; k < 8; k++) + for (k = 0; k < num_mb; k++) ahash_request_set_crypt(data[k].req, data[k].sg, data[k].result, speed[i].blen); @@ -484,7 +485,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, start = get_cycles(); - for (k = 0; k < 8; k++) { + for (k = 0; k < num_mb; k++) { ret = crypto_ahash_digest(data[k].req); if (ret == -EINPROGRESS) { ret = 0; @@ -509,7 +510,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, end = get_cycles(); cycles = end - start; pr_cont("%6lu cycles/operation, %4lu cycles/byte\n", - cycles, cycles / (8 * speed[i].blen)); + cycles, cycles / (num_mb * speed[i].blen)); if (ret) { pr_err("At least one hashing failed ret=%d\n", ret); @@ -518,10 +519,10 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, } out: - for (k = 0; k < 8; ++k) + for (k = 0; k < num_mb; ++k) ahash_request_free(data[k].req); - for (k = 0; k < 8; ++k) + for (k = 0; k < num_mb; ++k) testmgr_free_buf(data[k].xbuf); crypto_free_ahash(tfm); @@ -1815,19 +1816,23 @@ static int do_test(const char *alg, u32 type, u32 mask, int m) if (mode > 400 && mode < 500) break; /* fall through */ case 422: - test_mb_ahash_speed("sha1", sec, generic_hash_speed_template); + test_mb_ahash_speed("sha1", sec, generic_hash_speed_template, + num_mb); if (mode > 400 && mode < 500) break; /* fall through */ case 423: - test_mb_ahash_speed("sha256", sec, generic_hash_speed_template); + test_mb_ahash_speed("sha256", sec, generic_hash_speed_template, + num_mb); if (mode > 400 && mode < 500) break; /* fall through */ case 424: - test_mb_ahash_speed("sha512", sec, generic_hash_speed_template); + test_mb_ahash_speed("sha512", sec, generic_hash_speed_template, + num_mb); if (mode > 400 && mode < 500) break; /* fall through */ case 425: - test_mb_ahash_speed("sm3", sec, generic_hash_speed_template); + test_mb_ahash_speed("sm3", sec, generic_hash_speed_template, + num_mb); if (mode > 400 && mode < 500) break; /* fall through */ case 499: @@ -2106,6 +2111,8 @@ module_param(mode, int, 0); module_param(sec, uint, 0); MODULE_PARM_DESC(sec, "Length in seconds of speed tests " "(defaults to zero which uses CPU cycles instead)"); +module_param(num_mb, uint, 0000); +MODULE_PARM_DESC(num_mb, "Number of concurrent requests to be used in mb speed tests (defaults to 8)"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Quick & dirty crypto testing module");