aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest
diff options
context:
space:
mode:
authorNathan Lewis <[email protected]>2018-08-02 11:59:24 -0700
committerBrian Behlendorf <[email protected]>2018-08-02 11:59:24 -0700
commit010d12474cb1572c0c9b729615fa45cf43f59d14 (patch)
tree90decc0e3097d799852e8befeb7d6b8a1a5f4be8 /cmd/ztest
parent3d503a76e890d7711d5e906e025e092d0e244211 (diff)
Add support for selecting encryption backend
- Add two new module parameters to icp (icp_aes_impl, icp_gcm_impl) that control the crypto implementation. At the moment there is a choice between generic and aesni (on platforms that support it). - This enables support for AES-NI and PCLMULQDQ-NI on AMD Family 15h (bulldozer) and newer CPUs (zen). - Modify aes_key_t to track what implementation it was generated with as key schedules generated with various implementations are not necessarily interchangable. Reviewed by: Gvozden Neskovic <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Nathaniel R. Lewis <[email protected]> Closes #7102 Closes #7103
Diffstat (limited to 'cmd/ztest')
-rw-r--r--cmd/ztest/ztest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 5347a0abe..de3b9848e 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -129,6 +129,7 @@
#include <zfs_fletcher.h>
#include <libnvpair.h>
#include <libzfs.h>
+#include <sys/crypto/icp.h>
#ifdef __GLIBC__
#include <execinfo.h> /* for backtrace() */
#endif
@@ -3836,6 +3837,13 @@ ztest_dataset_create(char *dsname)
VERIFY0(dsl_crypto_params_create_nvlist(DCP_CMD_NONE, props,
crypto_args, &dcp));
+ /*
+ * Cycle through all available encryption implementations
+ * to verify interoperability.
+ */
+ VERIFY0(gcm_impl_set("cycle"));
+ VERIFY0(aes_impl_set("cycle"));
+
fnvlist_free(crypto_args);
fnvlist_free(props);
}