Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1170997ybl; Wed, 29 Jan 2020 16:50:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzureMRf4URViZzuhFI1+/7LOCloYsi0/2e73Ue6x4j2zpdGA9ABJSsk8q742lLesa3G5Ka X-Received: by 2002:aca:4ace:: with SMTP id x197mr1204857oia.23.1580345402176; Wed, 29 Jan 2020 16:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580345402; cv=none; d=google.com; s=arc-20160816; b=T9Xt9DhqEqP49DKdyrsgqWi9KHJNiTDkxIheJsagKLc3NebNqM1EbvvVjhuAVpQ/ox uTmWuLETw1yRX/V27775Bm0Z5TBeejmOjzDaYkDHQS4pZ9H88HJeg+gnstDSkLZffJ/k xrWRyLqOsYtq3QWe5TQpKdZ1ZjBSqHHZXmu1jmLso10Y2CszKR9GxlHb2+cZdqtt/YyF ZpRfT43O7IF4ZHFjvVcOgGFegicO5TZCAAeEzNaPac2loBv1p6YkDP8cHwdt+2QANPs8 cRDhOi31YzS7G0aFWvsqOsnCjYlPYRX8roWBuDwpqJbVEx63ub+6OWZa7Cun4xz2duXE myoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QmDr5v9asNe2A0psDmW7ADB4sFxL0IFcWlkzH8NjMJY=; b=x8r+Kis0rDg8YDVGqHwfQAkMFiF6LRDyPj5FK6L/Z9wByzoko3iaDEgDXBbwtvXbJy dUO1GBaVEDYHaOluddtIbrrZneV+DUjPHY7vPDawNnb7XgkT7aw2mZq9yBfcowaQQL+V 73BrNhZEZHfGIh8gHDz8Kh+dYJOZNUkR4OxBzK7TRrPhnDI2L2S5CXz7v3MMI1AJZSL1 gy1wGP8yS1sHKBP03uU0ACDepWfytLU4luB7+NXO2RZEsWW/BYJlThRjlo4WbdlBle2+ PbCX+1BZcpD8bSdkoZPv9Ru7KU9iuRb9Ed1r3jAFTjJz4WVWzal3O94dQoPpYoFnazJc IQcg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si1838042oti.303.2020.01.29.16.49.45; Wed, 29 Jan 2020 16:50:02 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726856AbgA3Atp (ORCPT + 99 others); Wed, 29 Jan 2020 19:49:45 -0500 Received: from inva020.nxp.com ([92.121.34.13]:42154 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgA3Atp (ORCPT ); Wed, 29 Jan 2020 19:49:45 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 65D321A01EC; Thu, 30 Jan 2020 01:49:43 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 570201A0535; Thu, 30 Jan 2020 01:49:43 +0100 (CET) Received: from lorenz.ea.freescale.net (lorenz.ea.freescale.net [10.171.71.5]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id EDBF9204BE; Thu, 30 Jan 2020 01:49:42 +0100 (CET) From: Iuliana Prodan To: Herbert Xu , Horia Geanta , Aymen Sghaier Cc: "David S. Miller" , Silvano Di Ninno , Franck Lenormand , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx , Iuliana Prodan Subject: [PATCH v5 0/9] crypto: caam - backlogging support Date: Thu, 30 Jan 2020 02:49:15 +0200 Message-Id: <1580345364-7606-1-git-send-email-iuliana.prodan@nxp.com> X-Mailer: git-send-email 2.1.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Integrate crypto_engine framework into CAAM, to make use of the engine queue. Added support for SKCIPHER, HASH, RSA and AEAD algorithms. This is intended to be used for CAAM backlogging support. The requests, with backlog flag (e.g. from dm-crypt) will be listed into crypto-engine queue and processed by CAAM when free. While here, I've also made some refactorization. Patches #1 - #4 include some refactorizations on caamalg, caamhash and caampkc. Patch #5 changes the return code of caam_jr_enqueue function to -EINPROGRESS, in case of success, -ENOSPC in case the CAAM is busy, -EIO if it cannot map the caller's descriptor. Patches #6 - #9 integrate crypto_engine into CAAM, for SKCIPHER/AEAD/RSA/HASH algorithms. --- Changes since V4: - reorganize {skcipher,aead,rsa}_edesc struct for a proper cacheline sharing. Changes since V3: - update return on ahash_enqueue_req function from patch #9. Changes since V2: - remove patch ("crypto: caam - refactor caam_jr_enqueue"), that added some structures not needed anymore; - use _done_ callback function directly for skcipher and aead; - handle resource leak in case of transfer request to crypto-engine; - update commit messages. Changes since V1: - remove helper function - akcipher_request_cast; - remove any references to crypto_async_request, use specific request type; - remove bypass crypto-engine queue, in case is empty; - update some commit messages; - remove unrelated changes, like whitespaces; - squash some changes from patch #9 to patch #6; - added Reviewed-by. Iuliana Prodan (9): crypto: caam - refactor skcipher/aead/gcm/chachapoly {en,de}crypt functions crypto: caam - refactor ahash_done callbacks crypto: caam - refactor ahash_edesc_alloc crypto: caam - refactor RSA private key _done callbacks crypto: caam - change return code in caam_jr_enqueue function crypto: caam - support crypto_engine framework for SKCIPHER algorithms crypto: caam - add crypto_engine support for AEAD algorithms crypto: caam - add crypto_engine support for RSA algorithms crypto: caam - add crypto_engine support for HASH algorithms drivers/crypto/caam/Kconfig | 1 + drivers/crypto/caam/caamalg.c | 416 ++++++++++++++++++----------------------- drivers/crypto/caam/caamhash.c | 341 ++++++++++++++++----------------- drivers/crypto/caam/caampkc.c | 187 +++++++++++------- drivers/crypto/caam/caampkc.h | 10 + drivers/crypto/caam/caamrng.c | 4 +- drivers/crypto/caam/intern.h | 2 + drivers/crypto/caam/jr.c | 37 +++- drivers/crypto/caam/key_gen.c | 2 +- 9 files changed, 523 insertions(+), 477 deletions(-) -- 2.1.0