]> granicus.if.org Git - zfs/commit
Enable SIMD for encryption
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Sep 2019 17:45:46 +0000 (10:45 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Sep 2019 17:45:46 +0000 (10:45 -0700)
commitb88ca2acf5129fe1fa7817b9d1dbf6a2ad43cda9
tree145f03bedf3ea850142885ae23c68f9a223597df
parentb63e2d881f859f0c7d8596be2759dd096e324f48
Enable SIMD for encryption

When adding the SIMD compatibility code in e5db313 the decryption of a
dataset wrapping key was left in a user thread context.  This was done
intentionally since it's a relatively infrequent operation.  However,
this also meant that the encryption context templates were initialized
using the generic operations.  Therefore, subsequent encryption and
decryption operations would use the generic implementation even when
executed by an I/O pipeline thread.

Resolve the issue by initializing the context templates in an I/O
pipeline thread.  And by updating zio_do_crypt_uio() to dispatch any
encryption operations to a pipeline thread when called from the user
context.  For example, when performing a read from the ARC.

Tested-by: Attila Fülöp <attila@fueloep.org>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9215
Closes #9296
include/sys/zio_crypt.h
module/os/linux/zfs/zio_crypt.c
module/zfs/arc.c
module/zfs/dsl_crypt.c