linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] crypto: caam - avoid allocating memory at crypto request runtime
@ 2020-12-03  1:35 Iuliana Prodan (OSS)
  2020-12-03  1:35 ` [PATCH 1/5] crypto: caam/jr - avoid allocating memory at crypto request runtime for skcipher Iuliana Prodan (OSS)
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Iuliana Prodan (OSS) @ 2020-12-03  1:35 UTC (permalink / raw)
  To: Herbert Xu, Ard Biesheuvel, David S. Miller, Horia Geanta
  Cc: Aymen Sghaier, Silvano Di Ninno, Franck Lenormand, linux-crypto,
	linux-kernel, linux-imx, Iuliana Prodan

From: Iuliana Prodan <iuliana.prodan@nxp.com>

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.

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 0/5] Remove CRYPTO_ALG_ALLOCATES_MEMORY flag
@ 2023-05-23 15:34 meenakshi.aggarwal
  2023-05-23 15:34 ` [PATCH 4/5] crypto: caam/qi - avoid allocating memory at crypto request runtime meenakshi.aggarwal
  0 siblings, 1 reply; 11+ messages in thread
From: meenakshi.aggarwal @ 2023-05-23 15:34 UTC (permalink / raw)
  To: horia.geanta, V.sethi, pankaj.gupta, gaurav.jain, herbert, davem,
	linux-crypto, linux-kernel, iuliana.prodan
  Cc: Meenakshi Aggarwal

From: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>

This series includes patches to remove CRYPTO_ALG_ALLOCATES_MEMORY flag
and allocate the required memory within the crypto request object.

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 1 for IV, and the same for dst, both aligned.
If the driver needs more than the 4 entries maximum, the memory
is dynamically allocated, at runtime.

Meenakshi Aggarwal (5):
  crypto:caam - avoid allocating memory at crypto request runtime for
    skcipher
  crypto:caam - avoid allocating memory at crypto request runtime for
    aead
  crypto: caam - avoid allocating memory at crypto request runtime for
    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     | 138 +++++++---
 drivers/crypto/caam/caamalg_qi.c  | 131 +++++++---
 drivers/crypto/caam/caamalg_qi2.c | 421 ++++++++++++++++++++----------
 drivers/crypto/caam/caamalg_qi2.h |   6 +
 drivers/crypto/caam/caamhash.c    |  77 ++++--
 5 files changed, 542 insertions(+), 231 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-23 15:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  1:35 [PATCH 0/5] crypto: caam - avoid allocating memory at crypto request runtime Iuliana Prodan (OSS)
2020-12-03  1:35 ` [PATCH 1/5] crypto: caam/jr - avoid allocating memory at crypto request runtime for skcipher Iuliana Prodan (OSS)
2020-12-03  1:35 ` [PATCH 2/5] crypto: caam/jr - avoid allocating memory at crypto request runtime for aead Iuliana Prodan (OSS)
2020-12-03  1:35 ` [PATCH 3/5] crypto: caam/jr - avoid allocating memory at crypto request runtime fost hash Iuliana Prodan (OSS)
2020-12-03  1:35 ` [PATCH 4/5] crypto: caam/qi - avoid allocating memory at crypto request runtime Iuliana Prodan (OSS)
2020-12-03  1:35 ` [PATCH 5/5] crypto: caam/qi2 " Iuliana Prodan (OSS)
2020-12-03  8:34 ` [PATCH 0/5] crypto: caam " Ard Biesheuvel
2020-12-03  8:38   ` Herbert Xu
2020-12-10  8:28 ` Horia Geantă
2020-12-11 10:09   ` Herbert Xu
2023-05-23 15:34 [PATCH 0/5] Remove CRYPTO_ALG_ALLOCATES_MEMORY flag meenakshi.aggarwal
2023-05-23 15:34 ` [PATCH 4/5] crypto: caam/qi - avoid allocating memory at crypto request runtime meenakshi.aggarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).