From patchwork Fri Oct 18 06:40:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sridhar, Kanchana P" X-Patchwork-Id: 13841231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86CFCD3C551 for ; Fri, 18 Oct 2024 06:41:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A362D6B008A; Fri, 18 Oct 2024 02:41:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FFC66B0095; Fri, 18 Oct 2024 02:41:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 575FD6B008C; Fri, 18 Oct 2024 02:41:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2E6CD6B0089 for ; Fri, 18 Oct 2024 02:41:09 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A216716183F for ; Fri, 18 Oct 2024 06:40:55 +0000 (UTC) X-FDA: 82685775648.11.106AB11 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by imf24.hostedemail.com (Postfix) with ESMTP id 8AE8518000C for ; Fri, 18 Oct 2024 06:41:04 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=nCEK20PB; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf24.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.15 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729233559; a=rsa-sha256; cv=none; b=qcxwqMd+VvjDRjDKiTkdxnGeYoeV4w6gT/oue46hwYOfqw5N3lmsCaxsJx1BmwdI3ELM34 OJ0JxWy2KGKDSiejXCrsgwYJ1BYdtZ/FGYV7zQKc3DhPLLQTgHvopkWBDhVRCJgEa6GTyb zY/mylUUHL9qPuCd9iHCeQH+nBfE9vg= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=nCEK20PB; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf24.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.15 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729233559; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/Y/NkeDIxfDZF+CxUEAyYeR12VREGHI06dwspDGrOWw=; b=EDZLupipreoZJ8YVjzx59gWWqbSjTjkWbiC7mNqkhFwjV5g5cnuxt1tQrAIbQqL/KRh05s yR4cgyW3TocLuNcZZ6mcu67gAY2kj//l9d939IkH8nJ6rckdAp5PLCJQ1jGyn4b07yNs8b EBmlpe3h6ljm2enR2MuJgmZjH+2tP50= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729233667; x=1760769667; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+wwI3G60HC02QVcBH/92bWn6u+fpHdMtlQxgJjc/fNE=; b=nCEK20PB9HxSGk3NItTgalE+oRj2mRYiK8mbb7NM9IzkWnZ5j8W5Rjv2 HjjiM97gYEFjbmBds6kKJ5grFG68aYDqaIWwcdO2FOBVClaz2alNhjEDt 8ovi0fv8oqZZohV9XaxJd8TzuFL22aslvw3R4v4+llP/Xmronxs5+hJlM LOA7cHjg1pHnfnlS8atOmBn/b3qLIWc76VFQbXQoQhnj2WJbPzyYd8EoQ eTBoOD/qX9k7xVdOf2WqR9P+0Qqq9waFPhBWey60sv2TgreGttw7fu1/a EszPmFkHzyK9VzEntZG8cZf9KcKj8R4nzAuYvy2bRBMeri4KhUoX21/6i Q==; X-CSE-ConnectionGUID: XuXtTK0uRfuDd10lDzfxDw== X-CSE-MsgGUID: h6uAsDivSWSEQNxCPLotXA== X-IronPort-AV: E=McAfee;i="6700,10204,11228"; a="28884812" X-IronPort-AV: E=Sophos;i="6.11,212,1725346800"; d="scan'208";a="28884812" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2024 23:41:02 -0700 X-CSE-ConnectionGUID: bd2/xxwGQ2WQ6ujF1GVEZA== X-CSE-MsgGUID: luRQ3pv+QyWsohgkCEdd8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="83607497" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by orviesa003.jf.intel.com with ESMTP; 17 Oct 2024 23:41:02 -0700 From: Kanchana P Sridhar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, usamaarif642@gmail.com, ryan.roberts@arm.com, ying.huang@intel.com, 21cnbao@gmail.com, akpm@linux-foundation.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, clabbe@baylibre.com, ardb@kernel.org, ebiggers@google.com, surenb@google.com, kristen.c.accardi@intel.com, zanussi@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, mcgrof@kernel.org, kees@kernel.org, joel.granados@kernel.org, bfoster@redhat.com, willy@infradead.org, linux-fsdevel@vger.kernel.org Cc: wajdi.k.feghali@intel.com, vinodh.gopal@intel.com, kanchana.p.sridhar@intel.com Subject: [RFC PATCH v1 03/13] crypto: testmgr - Add crypto testmgr acomp poll support. Date: Thu, 17 Oct 2024 23:40:51 -0700 Message-Id: <20241018064101.336232-4-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241018064101.336232-1-kanchana.p.sridhar@intel.com> References: <20241018064101.336232-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8AE8518000C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 9m7wjyfcds3eweeojnbtxdya6y9dwzqu X-HE-Tag: 1729233664-270688 X-HE-Meta: U2FsdGVkX19zCi+4x/RarSj+YZOyYR83NUqgYXDBfs+oirwIlol7t72m7+CyVlIz0u2/eUkF8DEVOIDszhWISjDFXowwWVJw16lMUnIOsvxHHR9E76nVfmPnKnfXRl4/7Pn27aroycttpUXNdGmKkn8ygN8I8+MjkU07DKhlhak5e/q7uL9d1M7QB7rN2n5SD2vIsOciL5ZGMxgBMP17w2dwg6sIYKDqV7r9rHzFfykKkKuStzTveGwHGRS/3B2s0gva0cKhkUVZ2MifpQ54XIkRxMZ23R8CkG8qRU2HpzETpiE761F5WOEAB42p4Mxy5SWKa6ZY5BqsEIhS+YuN2OeMsW3QFtGzhwuRiWZcWH03KtNq1PLYgLb0zELjsWEnLYncMnikeWuHTQSbaKwEcw4MZXIjlLLr2xzMzT1Pp4dZY1P0qmcIF7HHjSjJs0GgFUZttnQepxbOBQOnB8vTi4kYTz4CVDIIGMarPydh6B20fQfMAhVuERa0qpRd704ELyvXxd2chJVdKMpqQ1a67is+eafN8wT33x/44qeUPYM56kvhZWznAOlMlMiH1Nnlil3LUj1gb/pYBzQpJATU9lWQTKkB6X+FtdVRZEIpEtnY/3/tHPx0HADmF+RaI34Y+8iySuqYwsCulXf7H0dROHCynl3+cbXNIWVF1DlTARuFxHmeDxVt8JBGAT7rcqd2FdITsg5zg0WQNu84lIkEW/IUUZ+TsNPhRrODKENVBOyq8/P1ozH/GuJ8uWEAlfz3sIMQBjm/GqvaC5HPHS1NfS3vbuRm/St/eNsMEx9H7BIuYECvWqd1XxXc/IPFWIkaFMa934eodYTsfVew3jQc1Kg805i9krm0sVC8Q6Orn9lF/3JCTgrLLlKft3yMoo7y6k3x452ndwuyI33jW29gyn3vxENC7llsnnDN8u//BVuln5CFXun6H3LGM2+JBjjU/hbRy206RHuer/pNA+r T5vsuXW7 OJSE/WTcaSJHfmReGFdtjdl0lPHmCZqSzYSe2MyeDMBWsVlegQDI2qNrFHcw2NaywHqgQUheGn0wQ/u4HYaaQ61/UWT6XOJct/an3Z6C/jTl0HyleNpSYFy15OCa24mCznCxPMMs2MvGjO9nqRT1eiCNGarlXTudut/1FgDtttbU0aHEze26Cki4Frg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This patch enables the newly added acomp poll API to be exercised in the crypto test_acomp() calls to compress/decompress, if the acomp registers a poll method. Signed-off-by: Glover, Andre Signed-off-by: Kanchana P Sridhar --- crypto/testmgr.c | 70 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index ee8da628e9da..54f6f59ae501 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -3482,7 +3482,19 @@ static int test_acomp(struct crypto_acomp *tfm, acomp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, crypto_req_done, &wait); - ret = crypto_wait_req(crypto_acomp_compress(req), &wait); + if (tfm->poll) { + ret = crypto_acomp_compress(req); + if (ret == -EINPROGRESS) { + do { + ret = crypto_acomp_poll(req); + if (ret && ret != -EAGAIN) + break; + } while (ret); + } + } else { + ret = crypto_wait_req(crypto_acomp_compress(req), &wait); + } + if (ret) { pr_err("alg: acomp: compression failed on test %d for %s: ret=%d\n", i + 1, algo, -ret); @@ -3498,7 +3510,19 @@ static int test_acomp(struct crypto_acomp *tfm, crypto_init_wait(&wait); acomp_request_set_params(req, &src, &dst, ilen, dlen); - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + if (tfm->poll) { + ret = crypto_acomp_decompress(req); + if (ret == -EINPROGRESS) { + do { + ret = crypto_acomp_poll(req); + if (ret && ret != -EAGAIN) + break; + } while (ret); + } + } else { + ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + } + if (ret) { pr_err("alg: acomp: compression failed on test %d for %s: ret=%d\n", i + 1, algo, -ret); @@ -3531,7 +3555,19 @@ static int test_acomp(struct crypto_acomp *tfm, sg_init_one(&src, input_vec, ilen); acomp_request_set_params(req, &src, NULL, ilen, 0); - ret = crypto_wait_req(crypto_acomp_compress(req), &wait); + if (tfm->poll) { + ret = crypto_acomp_compress(req); + if (ret == -EINPROGRESS) { + do { + ret = crypto_acomp_poll(req); + if (ret && ret != -EAGAIN) + break; + } while (ret); + } + } else { + ret = crypto_wait_req(crypto_acomp_compress(req), &wait); + } + if (ret) { pr_err("alg: acomp: compression failed on NULL dst buffer test %d for %s: ret=%d\n", i + 1, algo, -ret); @@ -3574,7 +3610,19 @@ static int test_acomp(struct crypto_acomp *tfm, acomp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, crypto_req_done, &wait); - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + if (tfm->poll) { + ret = crypto_acomp_decompress(req); + if (ret == -EINPROGRESS) { + do { + ret = crypto_acomp_poll(req); + if (ret && ret != -EAGAIN) + break; + } while (ret); + } + } else { + ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + } + if (ret) { pr_err("alg: acomp: decompression failed on test %d for %s: ret=%d\n", i + 1, algo, -ret); @@ -3606,7 +3654,19 @@ static int test_acomp(struct crypto_acomp *tfm, crypto_init_wait(&wait); acomp_request_set_params(req, &src, NULL, ilen, 0); - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + if (tfm->poll) { + ret = crypto_acomp_decompress(req); + if (ret == -EINPROGRESS) { + do { + ret = crypto_acomp_poll(req); + if (ret && ret != -EAGAIN) + break; + } while (ret); + } + } else { + ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); + } + if (ret) { pr_err("alg: acomp: decompression failed on NULL dst buffer test %d for %s: ret=%d\n", i + 1, algo, -ret);