Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3984761ybg; Mon, 21 Oct 2019 01:47:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIofibvvfVP/LQGJfVPfRZygBFVgxJTxxnCCiheu8z72UjkZqgCHwy1IcXO9e8lfjiSyni X-Received: by 2002:a50:b634:: with SMTP id b49mr7094888ede.77.1571647667799; Mon, 21 Oct 2019 01:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571647667; cv=none; d=google.com; s=arc-20160816; b=MUkm7aWaBBbpdG9X5NYgzv20UV83pBx5iJr/ymsOcCiOGyertxmf1AYV+MMZ40LvJr P+5OStKDHnubFWvWTRLFPJHPkUq9NYFfDvn58aSe60335H/4SpUdxMYlVmSE97EkseP+ Va5/dVGWwjg4Lhv5mpyI+UpBobWrLanjLZu4ZrKG9LzbtpYL5H/ucT7CQBVn+eG17XnR iLz3DIP2NnitqFkP+k44y+to/rpH5p7EE9uUpkwXjd5bnEL9yiQ0wmbhIMA8FuPELHZT B++hv7zu4mVbq9P568PMp6Iy0xylClg9l6QAG9qiIJQrbC8d7iuZwHINM0WY3mHCrFQ2 A0RQ== 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=vT4W2vqooJwnIgGrfpiY6ZkbAmrv/xevJ/sssl0hLhc=; b=LJG6lIVN2RKHJqPhtU+Q5Fd5PnKQraGyjyMj3/JPfSi7emS5i8Vz04kaNSO7dKTS3C AyfnuMKHEbSZ6vhrwVx7Hla2k/9Gqr1QO7YfnTKb//ATYVPVJxma6V+0aR3yxvn5mQfM 0xx3QqcT3sR6ix7E6RGMFiaA2YVBrfNj2vazX0dJLQGWWAFED6WR1a4guh/aL4mDzCdG RnC2VVEwJ5c0uDOtIu99E/W7prKvQeT0HNT2YulbwWxvREPAtRjBH9MQYF8WmLV8bdyV +KjrvwGtygiuPropOuQCFCi/4wi7MyTPu6mu6Pqr3dYJrd1kxQhMH8NLL4JRXSHqZxfb NWuw== 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 y57si2333684edb.138.2019.10.21.01.47.21; Mon, 21 Oct 2019 01:47:47 -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 S1727140AbfJUIp0 (ORCPT + 99 others); Mon, 21 Oct 2019 04:45:26 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4738 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726725AbfJUIpZ (ORCPT ); Mon, 21 Oct 2019 04:45:25 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 22DB1DEB1D82C640D696; Mon, 21 Oct 2019 16:45:22 +0800 (CST) Received: from [127.0.0.1] (10.63.139.185) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Mon, 21 Oct 2019 16:45:15 +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> CC: "David S. Miller" , , From: Zhou Wang Message-ID: <5DAD701A.7010701@hisilicon.com> Date: Mon, 21 Oct 2019 16:45:14 +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: <20191021054559.GA32542@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/21 13:45, Herbert Xu wrote: > On Mon, Oct 21, 2019 at 12:00:00PM +0800, Zhou Wang wrote: >> >> seems it can not work, when I run insmod tcrypt.ko alg="zlib-deflate" type=10 mask=15 >> I got: insmod: can't insert 'tcrypt.ko': Resource temporarily unavailable > > This error is intentional. This is so that you can test again > without having to unload the module. Yes. > >> crypto_has_alg in case 0 in do_test does find "zlib-deflate", however, it breaks and >> do nothing about test. > > It doesn't have to do anything. As long as it causes the algorithm > to be registered the crypto API will test it automatically. So > after doing the modprobe, can you find the algorithm in /proc/crypto > and if so what does its test status say? 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. 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? Best, Zhou > > Cheers, >