Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp319927pxu; Thu, 3 Dec 2020 00:37:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEa0TY2NCP38RzJeDwB1VoR0p7BFfZINe02RenFPerxnv6GUnL/UaevMcRSwz1KfGbR2+N X-Received: by 2002:a17:906:2642:: with SMTP id i2mr1452898ejc.493.1606984654568; Thu, 03 Dec 2020 00:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606984654; cv=none; d=google.com; s=arc-20160816; b=uBm7Lu7WWU+5hvs/h4h7XKeTO+jaFVKdg/Ha9cleQ5n2yaab3uNNGp44wM0w1RnyB7 2Z+kU2hlB3/R7rv6vPRS5SOlPnk/lkcj9Ln85MsgB7CmP7A5JlDzQl9g+/O8KyjZ7YsY FVoA4H2yTpR8hfk9I1xrD3GYVE9c1KCbOvZsUTUtLyIhGGQuf/hy6Bf2dSLkT7BGNVhE lGQCF9g5wpdyuZVPBiJVtnDGFls2xB1+hJ4cYAyv6Vw0X13AV2AyAbagRa5QY6GCzTBh GTKuNQp7N0nN6drTomlKwA1TmWNW5Jhliz5UVEEkwTpgn9UV7F36zQtS68ETWObmQ8ra U3fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X8w6gOMmqQHHYRW64fqYica3+7b6Q7cR6UAadw5e7r8=; b=cgykcvC8NW6/gr3gq6B8NxyYa08yQ72cnv2t73ksjRW5b2JacOtNe3AHwjUBw+1l9X oahwpgxABWAWMqf6wRCzinE7jjN9IU+R833oRt1fsjHL33H32w72w1MNj0JTT5XAUCXC C7hmZ8I/mJ4uBupGmp8LDUXVdrajKQl+D7DGmzPZ/V753ZSPootjULoGlTCiVvmsweuH f/P/W18CO04X3773muVUsSxHmu4671lsayfMbU/87XqCrgGodsOL3vHG41QzLpCUuTme jAFu6IwceZ8bzQXgNLWYK7rTzPbrcWamgX0MM72eX2EzRWa4fkgAuMPOnfyE9mqeSN9E JgUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RoODslOz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si552256edt.200.2020.12.03.00.37.01; Thu, 03 Dec 2020 00:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RoODslOz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728704AbgLCIfC (ORCPT + 99 others); Thu, 3 Dec 2020 03:35:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:57570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgLCIfC (ORCPT ); Thu, 3 Dec 2020 03:35:02 -0500 X-Gm-Message-State: AOAM5318Q0F9G6RFSTrsh3ykdzXu3n9cO4RbPD2VBHqb7M//Ug/i98Ah 27C4IpykI7KfPhNTv6T28FVXpaCtP5+juUqsKW0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1606984461; bh=TNRBc8S70fvhf0yHPyoCSgJuCvQHb9iMJHwcNzjGzxc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RoODslOz3BhkHfLn8+8sRO2TBxS4PKAj8zSzfTJDcToF45/5pq2xVEWyOJdJlLPql kgHHkbGw5q14RS3IChotlTaVjAn24iEipCHSpLd/x9m4TR2ubLMsE7LfUz3cdtszAE 7GjBQONeiX/ZSZlHBgHqk70Tp43RogS91UnSGlXTfa8VA4h9cgWEQX/08wF2p+veP/ EA7qtYFuX+bT3EK8p5ujud0kvhM1bnsxf3awESRZrkuwcsqpznM1u/BjT5CWDl86Er d9IlxDmStAZzKkM7eKpJphr+k/T+uUPzrhTysKnUmCvl6N8+bK5X0wMknPe7n6swu6 jMU4GSZUez6wQ== X-Received: by 2002:a9d:62c1:: with SMTP id z1mr1341707otk.108.1606984460342; Thu, 03 Dec 2020 00:34:20 -0800 (PST) MIME-Version: 1.0 References: <20201203013524.30495-1-iuliana.prodan@oss.nxp.com> In-Reply-To: <20201203013524.30495-1-iuliana.prodan@oss.nxp.com> From: Ard Biesheuvel Date: Thu, 3 Dec 2020 09:34:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/5] crypto: caam - avoid allocating memory at crypto request runtime To: "Iuliana Prodan (OSS)" Cc: Herbert Xu , "David S. Miller" , Horia Geanta , Aymen Sghaier , Silvano Di Ninno , Franck Lenormand , Linux Crypto Mailing List , Linux Kernel Mailing List , linux-imx , Iuliana Prodan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 3 Dec 2020 at 02:35, Iuliana Prodan (OSS) wrote: > > From: Iuliana Prodan > > This series removes CRYPTO_ALG_ALLOCATES_MEMORY flag and > allocates the memory needed by the driver, to fulfil a > request, within the crypto request object. > The extra size needed for base extended descriptor, hw > descriptor commands and link tables is added to the reqsize > field that indicates how much memory could be needed per request. > > CRYPTO_ALG_ALLOCATES_MEMORY flag is limited only to > dm-crypt use-cases, which seems to be 4 entries maximum. > Therefore in reqsize we allocate memory for maximum 4 entries > for src and 4 for dst, aligned. > If the driver needs more than the 4 entries maximum, the memory > is dynamically allocated, at runtime. > I'm confused. So the driver does allocate memory in some cases, right? So why is it justified to remove CRYPTO_ALG_ALLOCATES_MEMORY? > Iuliana Prodan (5): > crypto: caam/jr - avoid allocating memory at crypto request runtime > for skcipher > crypto: caam/jr - avoid allocating memory at crypto request runtime > for aead > crypto: caam/jr - avoid allocating memory at crypto request runtime > fost hash > crypto: caam/qi - avoid allocating memory at crypto request runtime > crypto: caam/qi2 - avoid allocating memory at crypto request runtime > > drivers/crypto/caam/caamalg.c | 141 +++++++--- > drivers/crypto/caam/caamalg_qi.c | 134 ++++++---- > drivers/crypto/caam/caamalg_qi2.c | 415 ++++++++++++++++++++---------- > drivers/crypto/caam/caamalg_qi2.h | 6 + > drivers/crypto/caam/caamhash.c | 77 ++++-- > 5 files changed, 538 insertions(+), 235 deletions(-) > > -- > 2.17.1 >