From b88ca2acf5129fe1fa7817b9d1dbf6a2ad43cda9 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 10 Sep 2019 10:45:46 -0700 Subject: Enable SIMD for encryption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tom Caputi Signed-off-by: Brian Behlendorf Closes #9215 Closes #9296 --- module/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/zfs/arc.c') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 187158955..21f3dee07 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -8828,7 +8828,7 @@ l2arc_apply_transforms(spa_t *spa, arc_buf_hdr_t *hdr, uint64_t asize, if (ret != 0) goto error; - ret = zio_do_crypt_abd(B_TRUE, &dck->dck_key, + ret = zio_do_crypt_abd(spa, B_TRUE, &dck->dck_key, hdr->b_crypt_hdr.b_ot, bswap, hdr->b_crypt_hdr.b_salt, hdr->b_crypt_hdr.b_iv, mac, psize, to_write, eabd, &no_crypt); -- cgit v1.2.3