Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7959088ybl; Thu, 16 Jan 2020 08:21:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwt/KWiEMrKG2X3sv9SQ3hHL/R404RUS1mFZLvy3T6npbygj38qRcZXs5vqluScUIiWHlej X-Received: by 2002:aca:a949:: with SMTP id s70mr4746674oie.80.1579191696294; Thu, 16 Jan 2020 08:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579191696; cv=none; d=google.com; s=arc-20160816; b=h9Rb22aDDxaROwwcsa2QmtXk99WNobHYnQiXGjitajgwlG9gbRzxhHDUpoxYRpHdEZ QGdOM2SP2dGcc8afLnT9uWDPjj3B6QdUjS+5RDuLCY2aCdzPL5R5bwSo+j+8+aY7KbWJ Uoor5Ebslp2wim2xKSYIH76Ww1tt+4ST9qZtbIVKaOIw72S1vkBgiElguK6luniuSdvk InalAX3aPOez0gSIAUrhzcTLB9/qAyirTrAAhprPEi3K7iEZQ/6fw9mF1hGl0tDPz0oO R1LBtUUW15xcnZP15r/oRtG056jCAaNq/DWhanqs+AThMqAvmER4tUdDcy6vz5alfeet TE7w== 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=atv4uu+u4hvNs6DVJrOcLp51Dcw1jPKqR1CxkGq+NMs=; b=VTNnHoaKwVYlZyfhk66tMTPZK01fjagxz5nU6D90xaI8TADs5Clk7KPNhN7h68LjaB fScEktNCdyvPWbrhtgm0kfMrSIX4oxWDKJboHGq6ewHk+ne/MAl+cYpOL9EpAIqakTn+ y7pZhuykP8YmFFhATIS/8njl7L4kE48ArjXj3G+akPYZES1p4+QSjeSfv4s6YvCQnB2Q V0rG9TWWBxmJgu4DrfQyX8g0vI+AWTfvbEEeynuVR4nR27mqtEl1eEYbLdUTiKxpO0Eb 2zRwRED3/+1aZkJVLStNcmxkP9EhBt5P00ujxPXBZlNUNN8vyuSfXB0+Asn5zeejRL9k BZxQ== 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 i65si12113717oif.15.2020.01.16.08.21.16; Thu, 16 Jan 2020 08:21:36 -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 S1726151AbgAPQVK (ORCPT + 99 others); Thu, 16 Jan 2020 11:21:10 -0500 Received: from inva020.nxp.com ([92.121.34.13]:42214 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726935AbgAPQVJ (ORCPT ); Thu, 16 Jan 2020 11:21:09 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 39EEA1A0942; Thu, 16 Jan 2020 17:21:08 +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 2D29B1A06B0; Thu, 16 Jan 2020 17:21:08 +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 9589820567; Thu, 16 Jan 2020 17:21:07 +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 v3 0/9] crypto: caam - backlogging support Date: Thu, 16 Jan 2020 18:20:44 +0200 Message-Id: <1579191653-400-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 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