[PATCH v2 0/5] crypto: iaa - Fixes for multi entry SG lists
From: Vinicius Costa Gomes
Date: Wed Aug 05 2026 - 17:20:17 EST
Since commit e2c3b6b21c77 ("mm: zswap: use SG list decompression APIs
from zsmalloc"), iaa_crypto started seeing some failures with
multi-entry scatter lists.
For that we introduce software fallback, in patch 2/5, to iaa-crypto
when SG lists have more than one entry, for both input and output.
Patch 4/5 adds a bounce buffer so small/simple requests can be
linearized and sent to the hardware. This recovers most of the
performance.
Patch 1/5 updates the default resources reserved to iaa-crypto so more
engines are associated to the iaa_crypto group, resulting in better
utilization by default. Patch 3/5 fixes so software request "bytes"
are not counted as hardware "bytes". As the idxd changes only affect
iaa_crypto, sending them here makes more sense. Patch 5/5 fixes a
pre-existing issue pointed out by sashiko, that could cause data
corruption when a hardware error is reported.
A potential use-after-free issue when a descriptor submission times
out, pointed out by Sashiko, still remains and will be handled on a
future series.
It should be noted that as the software and hardware implementations
have different expectations for the window size, something like patch
[1] or the future 'set_params()' API are needed to verify that patch
2/5 works without patch 4/5.
[1] https://lore.kernel.org/linux-crypto/20260326100433.57324-1-giovanni.cabiddu@xxxxxxxxx/
Cheers,
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>
---
Changes in v2:
- Added patch 5/5, for a pre-existing issue, that touches the same
code paths as this series (Sashiko);
- I took an old version of Giovanni's patch 4/5, new version is
simpler to read; because of changes did not take Dave Jiang's
Reviewed-by;
- Added the missing Signed-off-by tags (Dave Jiang);
- Link to v1: https://patch.msgid.link/20260713-iaa-crypto-fixes-zswap-v1-0-65cac23c684d@xxxxxxxxx
---
Giovanni Cabiddu (4):
dmaengine: idxd: assign all engines to group 0 in IAA defaults
crypto: iaa - fall back to software for multi-entry scatterlists
crypto: iaa - avoid counting fallback decompression bytes
crypto: iaa - use bounce buffer for multi-sg decompress input
Vinicius Costa Gomes (1):
crypto: iaa - unmap dst before software fallback on decompress
drivers/crypto/intel/iaa/iaa_crypto_main.c | 270 +++++++++++++++++++---------
drivers/crypto/intel/iaa/iaa_crypto_stats.c | 9 +
drivers/crypto/intel/iaa/iaa_crypto_stats.h | 2 +
drivers/dma/idxd/defaults.c | 12 +-
4 files changed, 201 insertions(+), 92 deletions(-)
---
base-commit: 947d62c094367ef6064907d570b47612cd579df6
change-id: 20260713-iaa-crypto-fixes-zswap-ff5baae311d1
Best regards,
--
Vinicius