mbox series

[0/4] crypto: acomp - Add compression segmentation support

Message ID cover.1746102673.git.herbert@gondor.apana.org.au
Headers show
Series crypto: acomp - Add compression segmentation support | expand

Message

Herbert Xu May 1, 2025, 12:37 p.m. UTC
This patch series is a reboot of the acomp multibuffer patch series.
Instead of using request chaining, this time it is done using a
plain SG list and a unit size.

Either the Crypto API or optionally the algorithm can dice up the
request into unit-sized pieces.  The caller provides a single page
and a 2-entry SG list for output, and the Crypto API or algorithm
will dynamically extend it one page at a time through chaining if
necessary.  The compressed result will be tightly packed together.

If any unit fails to compress, a zero-length SG entry will be inserted
for it.

If at any time memory allocation fails (the first entry cannot fail
since it's compressed into memory provided by the caller), then
compression will stop and the caller can process what has been
compressed so far before resuming by calling with an offset into
the original SG list.

Herbert Xu (4):
  crypto: acomp - Clone folios properly
  crypto: api - Rename CRYPTO_ALG_REQ_CHAIN to CRYPTO_ALG_REQ_VIRT
  crypto: acomp - Add compression segmentation support
  crypto: testmgr - Add multibuffer acomp testing

 crypto/acompress.c                  | 172 ++++++++++++++++++++++++++--
 crypto/ahash.c                      |   6 +-
 crypto/algapi.c                     |   3 +
 crypto/deflate.c                    |   2 +-
 crypto/scompress.c                  |   2 +-
 crypto/testmgr.c                    | 145 ++++++++++++-----------
 include/crypto/acompress.h          | 107 +++++++++++++++--
 include/crypto/algapi.h             |   9 +-
 include/crypto/internal/acompress.h |  14 ++-
 include/crypto/internal/hash.h      |   4 +-
 include/linux/crypto.h              |   7 +-
 11 files changed, 367 insertions(+), 104 deletions(-)