diff options
author | cfzhu <[email protected]> | 2019-04-17 03:38:36 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-04-16 12:38:36 -0700 |
commit | 5090f72743f5a587b1a8b64aaa1023913735d0bf (patch) | |
tree | 6ab4731f14ffebc4895e31c7aed85ce8970fa45e /module/zfs/qat.c | |
parent | 59f6594cf605635c22311c7f0752bbc67807a508 (diff) |
Code improvement and bug fixes for QAT support
1. Support QAT when ZFS is root file-system:
When ZFS module is loaded before QAT started, the QAT can
be started again in post-process, e.g.:
echo 0 > /sys/module/zfs/parameters/zfs_qat_compress_disable
echo 0 > /sys/module/zfs/parameters/zfs_qat_encrypt_disable
echo 0 > /sys/module/zfs/parameters/zfs_qat_checksum_disable
2. Verify alder checksum of the de-compress result
3. Allocate Digest, IV and AAD buffer in physical contiguous
memory by QAT_PHYS_CONTIG_ALLOC.
4. Update the documentation for zfs_qat_compress_disable,
zfs_qat_checksum_disable, zfs_qat_encrypt_disable.
Reviewed-by: Tom Caputi <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Weigang Li <[email protected]>
Signed-off-by: Chengfeix Zhu <[email protected]>
Closes #8323
Closes #8610
Diffstat (limited to 'module/zfs/qat.c')
-rw-r--r-- | module/zfs/qat.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/module/zfs/qat.c b/module/zfs/qat.c index 0a4f9c72a..a6f024cb4 100644 --- a/module/zfs/qat.c +++ b/module/zfs/qat.c @@ -66,18 +66,6 @@ qat_mem_free_contig(void **pp_mem_addr) int qat_init(void) { - int ret; - - ret = qat_dc_init(); - if (ret != 0) - return (ret); - - ret = qat_crypt_init(); - if (ret != 0) { - qat_dc_fini(); - return (ret); - } - qat_ksp = kstat_create("zfs", 0, "qat", "misc", KSTAT_TYPE_NAMED, sizeof (qat_stats) / sizeof (kstat_named_t), KSTAT_FLAG_VIRTUAL); @@ -86,6 +74,19 @@ qat_init(void) kstat_install(qat_ksp); } + /* + * Just set the disable flag when qat init failed, qat can be + * turned on again in post-process after zfs module is loaded, e.g.: + * echo 0 > /sys/module/zfs/parameters/zfs_qat_compress_disable + */ + if (qat_dc_init() != 0) + zfs_qat_compress_disable = 1; + + if (qat_cy_init() != 0) { + zfs_qat_checksum_disable = 1; + zfs_qat_encrypt_disable = 1; + } + return (0); } @@ -97,7 +98,7 @@ qat_fini(void) qat_ksp = NULL; } - qat_crypt_fini(); + qat_cy_fini(); qat_dc_fini(); } |