Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp321360pxu; Thu, 3 Dec 2020 00:41:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzHtTb2cjryYNdLUCBVvb/OO2aQts/69AWvQSdYxygnaq6/yaGHwKzSQJDZFYwoCxcBccI X-Received: by 2002:a17:906:a047:: with SMTP id bg7mr1545040ejb.30.1606984871636; Thu, 03 Dec 2020 00:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606984871; cv=none; d=google.com; s=arc-20160816; b=hkbcjC9QyR0YZcYJJrCb3mFzlnL54ZNG7WJpWnkGtuZh3drkXl+TjK/sFAPEL5VP7I 9p42iSLUDq4SufkhMr+A72zQPaL02T/tUzBsdU7pQPyXbA4Vf0cF0/mGQGPCo7wzfHsd 9t+IhbImdhqvYoR8KKjPqaLm5IO38AcD6CBTZZsByRAhmssTYiY/z5w07etNp6fH04wy Q5wyhsGGyla/XYnWvW+1/o4kyiapRCX3D2f3PWjDYJtAseAFVwz94NYc0JMWoYMZwSfW n+zd7saZpqflz55aCVxZ/yQcLZ5VlzU8O0uLcR5kdh0fXCTXMx6/Xn8Gw9MS3zxEt6qa BPag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=/xOq2TuF5dGNAekuV/O5a2xVIwhZFlvqjHVBvHBBfsU=; b=NawTkhnsxPvQluP02Tbi9ZOXvW8DR+Jm+kkvCIF9jlK8iAGe4pp+Rc7wPELcNSpf8x 9rAD2GG1hdNmnnSRj70qvL9sZeb23HHPYVZ9/pXhmzLx+lMGzXL/qFK/5l6DYEKN61gz g3xMEINWOb1npO51MkEcZGOyd0rPnhUz8UHEULtjNQVY0O2a6YJN2E8ybNXlT1I93o7c b3yd1uzkZ7Vjn0D117kva32pY3yhs+NaszjJUEpD+TwEWmxvDBcrjtQ0PwZ8y9ZAjC92 f/epph9rHoFG4RnR3Jq5IibMWRYfKMYOVRsEyWcSdxC02YAc3y/pL2Kdr4negmS1mDpx cPZA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si541998edj.73.2020.12.03.00.40.48; Thu, 03 Dec 2020 00:41:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbgLCIjZ (ORCPT + 99 others); Thu, 3 Dec 2020 03:39:25 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:57736 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbgLCIjU (ORCPT ); Thu, 3 Dec 2020 03:39:20 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kkk8D-00055r-5D; Thu, 03 Dec 2020 19:38:30 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 03 Dec 2020 19:38:29 +1100 Date: Thu, 3 Dec 2020 19:38:29 +1100 From: Herbert Xu To: Ard Biesheuvel Cc: "Iuliana Prodan (OSS)" , "David S. Miller" , Horia Geanta , Aymen Sghaier , Silvano Di Ninno , Franck Lenormand , Linux Crypto Mailing List , Linux Kernel Mailing List , linux-imx , Iuliana Prodan Subject: Re: [PATCH 0/5] crypto: caam - avoid allocating memory at crypto request runtime Message-ID: <20201203083829.GA20873@gondor.apana.org.au> References: <20201203013524.30495-1-iuliana.prodan@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Dec 03, 2020 at 09:34:08AM +0100, Ard Biesheuvel wrote: > > > 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? Because it's only required by dm-crypt, we should modify the semantics for ALLOCATES_MEMORY such that it only includes those that require allocations even when the SG list is of 4 entries or less. We should update the documentation. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt