Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5257708ybg; Tue, 22 Oct 2019 00:13:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGVH68MvWmxSS15Je1MPUGFCGxNO/vOxn/5p+42AwXYD6NwDXsSfstsvIg4zWi19yGlqYI X-Received: by 2002:a50:b966:: with SMTP id m93mr28969330ede.228.1571728423308; Tue, 22 Oct 2019 00:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571728423; cv=none; d=google.com; s=arc-20160816; b=PeeClqzqaJWbYj6nmtrG7At671h/TM4A+prd9VjCvUemjxy9DeDjWs/b6sr51SF6qC laJjWr5Wd2EJtftRvizTHxRisuOEGzNEMCRieMUD/pLTAFxkdWkTbWITO8e84YHgj+2n NppCs3SefumgFoOmWJzanytqfHEli/eW38QXxtuLDEp6tEfyrAL1iDJ1YCSOECXcTyaE HtK2sfe26foQQMoQ3xEriM55LRhzkvgO9HY1h8zLSv+SffEw4MTQ93Lj3VqfO0vspz7H bVq5pm78x2NniX5aaTNIyuRhaPBGhF9KyywmqSH+QeOrV3wX4eYdEsIB/HJCxImXWgRV 03oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=JC0qQpYVMCmLWrVwxs2d+f9gHeV9svw7EngbGTwM6f0=; b=MWItvTCOpae5nrOSknfpRqFaDLPrVlWuMVoDm+7QQ1bxMcd2hYp+zWc1NFLcub5JTR Y2loYMEzSZ7kFPR8ZFQL5J45cmAuFtlPs5wutbyYJfl2ho8CteVHKlN6r6OIkMlJZigM j4Y9gn6r5ikn4MHYkEf0DWkmMD2RHqtR+ax2RQ6x2G6Mhd4bF+KaZ+9uE0CJNFtFPTEy /p68SfAk8Pn5tOJisgqqHKazPk6l/kAaa9Img6h7j1o1vnSj7WyF2DMGN3TxswVmR9uo 3guqdj46yA1sGjYjw1GiZfjhxcsq80v9XgI0rZnYAxTE+xPWfXLEx3yJEiMId59m9qt/ fggw== 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 q1si12032107edj.354.2019.10.22.00.13.18; Tue, 22 Oct 2019 00:13:43 -0700 (PDT) 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 S2387889AbfJVHFF (ORCPT + 99 others); Tue, 22 Oct 2019 03:05:05 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4745 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387888AbfJVHFE (ORCPT ); Tue, 22 Oct 2019 03:05:04 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 939BA7EF37AB7675DC23; Tue, 22 Oct 2019 15:05:01 +0800 (CST) Received: from [127.0.0.1] (10.63.139.185) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Tue, 22 Oct 2019 15:04:52 +0800 Subject: Re: [PATCH] crypto: zlib-deflate - add zlib-deflate test case in tcrypt To: Herbert Xu References: <1570695707-46528-1-git-send-email-wangzhou1@hisilicon.com> <20191018071424.GA16131@gondor.apana.org.au> <5DAD2D40.6000901@hisilicon.com> <20191021054559.GA32542@gondor.apana.org.au> <5DAD701A.7010701@hisilicon.com> <20191022061550.jak3xnou2gezdfxf@gondor.apana.org.au> CC: "David S. Miller" , , From: Zhou Wang Message-ID: <5DAEAA14.3020208@hisilicon.com> Date: Tue, 22 Oct 2019 15:04:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20191022061550.jak3xnou2gezdfxf@gondor.apana.org.au> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.63.139.185] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2019/10/22 14:15, Herbert Xu wrote: > On Mon, Oct 21, 2019 at 04:45:14PM +0800, Zhou Wang wrote: >> >> I made CRYPTO_MANAGER_DISABLE_TESTS=n and CRYPTO_TEST=m. After loading >> hisi_qm and hisi_zip modules, I got: >> >> [ 138.232605] hisi_zip 0000:75:00.0: Adding to iommu group 40 >> [ 138.239325] hisi_zip 0000:75:00.0: enabling device (0000 -> 0002) >> [ 138.245896] hisi_zip 0000:b5:00.0: Adding to iommu group 41 >> [ 138.252435] hisi_zip 0000:b5:00.0: enabling device (0000 -> 0002) >> [ 138.260393] alg: No test for gzip (hisi-gzip-acomp) >> >> This is OK: as the test of zlib-deflate of hisi_zip was successful, so >> it was quiet, as there is no test case for gzip, so it printed above message. >> >> cat /proc/crypto, I got: >> name : gzip >> driver : hisi-gzip-acomp >> module : hisi_zip >> priority : 300 >> refcnt : 1 >> selftest : passed >> internal : no >> type : acomp >> >> name : zlib-deflate >> driver : hisi-zlib-acomp >> module : hisi_zip >> priority : 300 >> refcnt : 1 >> selftest : passed >> internal : no >> type : acomp >> [...] >> >> However, seems we can not trigger a test by loading tcrypto. > > The test has already been carried out when the algorithm is > registered. Testing twice doesn't change anything. To trigger > a new test, unload the algorithm and then run tcrypt again. > >> Do you mean as crypto_has_alg can detect if an alg has already >> been tested, so it directly breaks in the case 0 in do test in tcrypto? > > As I said, tests are always carried out at registration time so > by triggering the registration tcrypt knows that the test would > have already occured. > > In fact this tcrypt code exists only for legacy reasons. You can > also trigger the registration directly by loading your modules or > for templates use crconf. I got it, thanks for your explanation. Will stop to do this. Best, Zhou > > Cheers, >