Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1826600rwb; Fri, 12 Aug 2022 07:28:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7g3+UMvBhdoP/qmuPpJKP05eSTR4mNWdhF23jf34J00K9yD1cgRK9eoEXx0+A47V9Pwmmw X-Received: by 2002:a17:902:c651:b0:171:5627:2260 with SMTP id s17-20020a170902c65100b0017156272260mr3551858pls.166.1660314484216; Fri, 12 Aug 2022 07:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660314484; cv=none; d=google.com; s=arc-20160816; b=oWPupPayKZv2FU5dyAAP2LtHfmLDW5Wjj37lybBvQPV3ST9FXQsXVCbUbzjLTuzFkN t/VJwWi95zXU5A5tcQg61OvU9hhdKRelEFjj8Xrlm0+neehcVSJwnkHfAuXbysXf2QZE nLIFrOwt5tz7hayPgu/R+iU/MrdcT+jZ95+I2C0P5/VIvpD2+D8rPxvIyPF7qXIXor96 dmw/FCZ8gk7HscdnNDXCpNYOKIUpHnXrea3Bu8KDPp2NqGsNwnD+FLFcAT5coLjuq6uh tUvokok18AczyEz8N6yMex9c7kzlG0xHFSyHECqqIszG3pUaBEEdAvd9+9kQ/77FdDD/ AmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=jBomoSonm+i8RMf0sUQoaa0+pTWRiDZ0ZD+mqHdvzYU=; b=YmD/QwAXtw+AUu85c2WJlzC3a21h9yeA+jt+ZS7b+aHOb13Nc9EAiR4ldzQqxhEVXa aMS1zftIMN3vbqxwprVpSQiq3l5mr1id9v/uzUAOkYVC1q/F5y68aAyi4At5RkjHX/cW RA3lFEMp7WZdxnyzQI5cTVUaViOiT29iAi83NLZKwBRH0TWF5MqboXLPoZhlETIaxfL9 OmJimJitU6Tklw/6eLKSWEwj8lhNSmHFRd+/AtjU/35IssidPg4EzqWIGRRezZxAF/Ha F+GcFGmwgpkD5+hm7PGmEFRfQa0MDoAYUaAVX8atDuyxhmfum7RY8aEyoYygldfNCeP7 tfuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b9OtLUfM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l71-20020a63914a000000b003816043f10bsi2548920pge.768.2022.08.12.07.27.35; Fri, 12 Aug 2022 07:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b9OtLUfM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbiHLOQq (ORCPT + 99 others); Fri, 12 Aug 2022 10:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239148AbiHLOQX (ORCPT ); Fri, 12 Aug 2022 10:16:23 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49F387697B for ; Fri, 12 Aug 2022 07:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660313782; x=1691849782; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ll0tucs6GTmwW6IXKFv5XRG5pDUiX7dLKYD4OvDfnT8=; b=b9OtLUfMUDGj2snQUK0EI9c0Uj4TLARJC/YgG9gbYbQwWcbjqMfNgZcU hOAUirddaIcFiVFz8dtOX3kvUURB9ccYoFwSTpAFcZ/uWQmTg2vSsjqOF uuj2slowg46OBu3Q9UOlL3Kkc0Hi0N7MBzt9OuSrA8KaHVUR5jKp6S5fe K7w/K++7qmC5sYeJKWQy3GzNyBNb4TAWoLBkb7xNx2UpFwOXRwQJ9lGHc v3MatOMxy5FKh0nrizbClFIF89SYf1XuHnJ6AwSH1OFpG0K5y3PqsN2X7 D2AXoWXL/ITOXYx22OCMCLV5wKA9vHJvm033lsOceXdmc8OKIPf8TnSA9 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10437"; a="292867748" X-IronPort-AV: E=Sophos;i="5.93,233,1654585200"; d="scan'208";a="292867748" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2022 07:16:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,233,1654585200"; d="scan'208";a="748206689" Received: from sdpcloudhostegs034.jf.intel.com ([10.165.126.39]) by fmsmga001.fm.intel.com with ESMTP; 12 Aug 2022 07:16:20 -0700 From: Lucas Segarra Fernandez To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Lucas Segarra Fernandez , Giovanni Cabiddu Subject: [PATCH] crypto: testmgr - extend acomp tests for NULL destination buffer Date: Fri, 12 Aug 2022 16:16:02 +0200 Message-Id: <20220812141602.5571-1-lucas.segarra.fernandez@intel.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Acomp API supports NULL destination buffer for compression and decompression requests. In such cases allocation is performed by API. Add test cases for crypto_acomp_compress() and crypto_acomp_decompress() with dst buffer allocated by API. Tests will only run if CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu --- crypto/testmgr.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 5349ffee6bbd..bf905c1e89ed 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -3417,6 +3417,21 @@ static int test_acomp(struct crypto_acomp *tfm, goto out; } +#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS + crypto_init_wait(&wait); + 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 (ret) { + pr_err("alg: acomp: compression failed on NULL dst buffer test %d for %s: ret=%d\n", + i + 1, algo, -ret); + kfree(input_vec); + acomp_request_free(req); + goto out; + } +#endif + kfree(input_vec); acomp_request_free(req); } @@ -3478,6 +3493,20 @@ static int test_acomp(struct crypto_acomp *tfm, goto out; } +#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS + crypto_init_wait(&wait); + acomp_request_set_params(req, &src, NULL, ilen, 0); + + 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); + kfree(input_vec); + acomp_request_free(req); + goto out; + } +#endif + kfree(input_vec); acomp_request_free(req); } -- 2.37.1