zfs/lib
Attila Fülöp 76354f945e ICP: Improve AES-GCM performance
Currently SIMD accelerated AES-GCM performance is limited by two
factors:

a. The need to disable preemption and interrupts and save the FPU
state before using it and to do the reverse when done. Due to the
way the code is organized (see (b) below) we have to pay this price
twice for each 16 byte GCM block processed.

b. Most processing is done in C, operating on single GCM blocks.
The use of SIMD instructions is limited to the AES encryption of the
counter block (AES-NI) and the Galois multiplication (PCLMULQDQ).
This leads to the FPU not being fully utilized for crypto
operations.

To solve (a) we do crypto processing in larger chunks while owning
the FPU. An `icp_gcm_avx_chunk_size` module parameter was introduced
to make this chunk size tweakable. It defaults to 32 KiB. This step
alone roughly doubles performance. (b) is tackled by porting and
using the highly optimized openssl AES-GCM assembler routines, which
do all the processing (CTR, AES, GMULT) in a single routine. Both
steps together result in up to 32x reduction of the time spend in
the en/decryption routines, leading up to approximately 12x
throughput increase for large (128 KiB) blocks.

Lastly, this commit changes the default encryption algorithm from
AES-CCM to AES-GCM when setting the `encryption=on` property.

Reviewed-By: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-By: Jason King <jason.king@joyent.com>
Reviewed-By: Tom Caputi <tcaputi@datto.com>
Reviewed-By: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #9749
2020-05-12 10:53:32 -07:00
..
libavl Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libefi cppcheck: (error) Memory leak: vtoc 2020-01-22 13:49:06 -08:00
libicp ICP: Improve AES-GCM performance 2020-05-12 10:53:32 -07:00
libnvpair Use correct format string when printing int8 2020-01-22 13:49:03 -08:00
libshare Fix static data to link with -fno-common 2020-05-12 10:53:32 -07:00
libspl Linux 5.6 compat: time_t 2020-05-12 10:53:32 -07:00
libtpool Fix typos in lib/ 2020-01-22 13:48:59 -08:00
libunicode Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libuutil Update build system and packaging 2018-05-29 16:00:33 -07:00
libzfs Deprecate deduplicated send streams 2020-05-12 10:53:32 -07:00
libzfs_core Use ZFS_DEV macro instead of literals 2019-09-25 11:27:48 -07:00
libzpool Implement -A (ignore ASSERTs) for zdb 2020-01-22 13:49:04 -08:00
libzutil Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS 2020-01-22 13:49:03 -08:00
Makefile.am Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00