From patchwork Mon Aug 3 17:01:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 6931261 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C1879F358 for ; Mon, 3 Aug 2015 17:01:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B164E2063C for ; Mon, 3 Aug 2015 17:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF54420374 for ; Mon, 3 Aug 2015 17:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754589AbbHCRBy (ORCPT ); Mon, 3 Aug 2015 13:01:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:6636 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbbHCRBy (ORCPT ); Mon, 3 Aug 2015 13:01:54 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 03 Aug 2015 10:01:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,602,1432623600"; d="scan'208";a="776889828" Received: from unknown (HELO tstruk-mobl1.intel.com) ([134.134.171.177]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2015 10:01:52 -0700 Message-ID: <55BF9E4E.6020006@intel.com> Date: Mon, 03 Aug 2015 10:01:02 -0700 From: Tadeusz Struk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Herbert Xu CC: Linux Crypto Mailing List Subject: Re: [PATCH 6/8] crypto: qat - Convert to new AEAD interface References: <20150730094138.GA15941@gondor.apana.org.au> <55BBDD1F.4020208@intel.com> <20150802012354.GB10055@gondor.apana.org.au> In-Reply-To: <20150802012354.GB10055@gondor.apana.org.au> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. --- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;