linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tadeusz Struk <tadeusz.struk@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH 6/8] crypto: qat - Convert to new AEAD interface
Date: Mon, 03 Aug 2015 10:01:02 -0700	[thread overview]
Message-ID: <55BF9E4E.6020006@intel.com> (raw)
In-Reply-To: <20150802012354.GB10055@gondor.apana.org.au>

On 08/01/2015 06:23 PM, Herbert Xu wrote:
> On Fri, Jul 31, 2015 at 01:39:59PM -0700, Tadeusz Struk wrote:
>> On 07/30/2015 02:53 AM, Herbert Xu wrote:
>>> -}, {
>>> +	.init = qat_alg_aead_sha512_init,
>>> +	.exit = qat_alg_aead_exit,
>>> +	.setkey = qat_alg_aead_setkey,
>>> +	.decrypt = qat_alg_aead_dec,
>>> +	.encrypt = qat_alg_aead_enc,
>>> +	.ivsize = AES_BLOCK_SIZE,
>>> +	.maxauthsize = SHA512_DIGEST_SIZE,
>>
>> Hi Herbert,
>> crypto_aead_encrypt() and crypto_aead_decrypt() work fine, but crypto_aead_givencrypt(),
>> which is still supported on the API causes a crash. Should we also disable all the
>> crypto_aead_giv* calls? I use it in my internal tests.
> 
> givencrypt will be removed once all drivers are converted across.
> So it must not be used.
Hi Herbert,
There is one problem that I missed before.
We can shutdown a qat device and bring it back up via ioct.
Before we shut the last device we also unregister the algorithms.
Then we can bring them up again, but it fails without resetting the flags.

--- 8< ---
QAT algorithms can be registered and unregistered without
removing the qat module via ioctl, therefore they need to
have their flags reset before each register.

diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_algs.c
index 45420a6..1411e4c 100644
--- a/drivers/crypto/qat/qat_common/qat_algs.c
+++ b/drivers/crypto/qat/qat_common/qat_algs.c
@@ -1183,16 +1183,22 @@ static struct crypto_alg qat_algs[] = { {
 
 int qat_algs_register(void)
 {
-	int ret = 0;
+	int ret = 0, i;
 
 	mutex_lock(&algs_lock);
 	if (++active_devs != 1)
 		goto unlock;
 
+	for (i = 0; i < ARRAY_SIZE(qat_algs); i++)
+		qat_algs[i].cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC;
+
 	ret = crypto_register_algs(qat_algs, ARRAY_SIZE(qat_algs));
 	if (ret)
 		goto unlock;
 
+	for (i = 0; i < ARRAY_SIZE(qat_aeads); i++)
+		qat_aeads[i].base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_AEAD_NEW;
+
 	ret = crypto_register_aeads(qat_aeads, ARRAY_SIZE(qat_aeads));
 	if (ret)
 		goto unreg_algs;

  reply	other threads:[~2015-08-03 17:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  9:41 [PATCH 0/8] crypto: aed - Convert authenc to new interface Herbert Xu
2015-07-30  9:53 ` [PATCH 1/8] crypto: testmgr - Disable authenc test and convert test vectors Herbert Xu
2015-07-30  9:53 ` [PATCH 2/8] crypto: authenc - Convert to new AEAD interface Herbert Xu
2015-07-30  9:53 ` [PATCH 3/8] crypto: caam - Convert authenc " Herbert Xu
2015-07-30  9:53 ` [PATCH 4/8] crypto: ixp4xx - Convert " Herbert Xu
2015-07-30  9:53 ` [PATCH 5/8] crypto: picoxcell " Herbert Xu
2015-07-30  9:53 ` [PATCH 6/8] crypto: qat " Herbert Xu
2015-07-31 20:39   ` Tadeusz Struk
2015-08-02  1:23     ` Herbert Xu
2015-08-03 17:01       ` Tadeusz Struk [this message]
2015-08-04  9:59         ` Herbert Xu
2015-08-04 12:47           ` Herbert Xu
2015-08-04 13:28             ` Tadeusz Struk
2015-08-04 13:26           ` Tadeusz Struk
2015-08-04 13:32             ` Herbert Xu
2015-08-04 13:42               ` Tadeusz Struk
2015-08-04 13:44                 ` Herbert Xu
2015-08-04 13:50                   ` Tadeusz Struk
2015-07-30  9:53 ` [PATCH 7/8] crypto: talitos " Herbert Xu
2015-07-30  9:53 ` [PATCH 8/8] crypto: testmgr - Reenable authenc tests Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BF9E4E.6020006@intel.com \
    --to=tadeusz.struk@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).