Re: [PATCH v4 1/4] crypto: Introduce crypto_pool

From: Herbert Xu
Date: Thu Jan 19 2023 - 04:51:54 EST


On Wed, Jan 18, 2023 at 09:41:08PM +0000, Dmitry Safonov wrote:
> Introduce a per-CPU pool of async crypto requests that can be used
> in bh-disabled contexts (designed with net RX/TX softirqs as users in
> mind). Allocation can sleep and is a slow-path.
> Initial implementation has only ahash as a backend and a fix-sized array
> of possible algorithms used in parallel.
>
> Signed-off-by: Dmitry Safonov <dima@xxxxxxxxxx>
> ---
> crypto/Kconfig | 3 +
> crypto/Makefile | 1 +
> crypto/crypto_pool.c | 333 ++++++++++++++++++++++++++++++++++++++++++
> include/crypto/pool.h | 46 ++++++
> 4 files changed, 383 insertions(+)
> create mode 100644 crypto/crypto_pool.c
> create mode 100644 include/crypto/pool.h

I'm still nacking this.

I'm currently working on per-request keys which should render
this unnecessary. With per-request keys you can simply do an
atomic kmalloc when you compute the hash.

Modelling tcp_md5 is just propagating bad code.

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt