QAT related bug fixes

1. Fix issue:  Kernel BUG with QAT during decompression  #9276.
   Now it is uninterruptible for a specific given QAT request,
   but Ctrl-C interrupt still works in user-space process.

2. Copy the digest result to the buffer only when doing encryption,
   and vise-versa for decryption.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chengfei Zhu <chengfeix.zhu@intel.com>
Closes #9276 
Closes #9303
This commit is contained in:
Chengfei ZHu
2019-09-13 04:33:44 +08:00
committed by Brian Behlendorf
parent 4f342e45be
commit 7238cbd4d3
4 changed files with 18 additions and 32 deletions
+3 -11
View File
@@ -27,7 +27,7 @@
#include <sys/zfs_context.h>
#include <sys/byteorder.h>
#include <sys/zio.h>
#include "qat.h"
#include <sys/qat.h>
/*
* Max instances in a QAT device, each instance is a channel to submit
@@ -403,11 +403,7 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len,
}
/* we now wait until the completion of the operation. */
if (!wait_for_completion_interruptible_timeout(&complete,
QAT_TIMEOUT_MS)) {
status = CPA_STATUS_FAIL;
goto fail;
}
wait_for_completion(&complete);
if (dc_results.status != CPA_STATUS_SUCCESS) {
status = CPA_STATUS_FAIL;
@@ -462,11 +458,7 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len,
}
/* we now wait until the completion of the operation. */
if (!wait_for_completion_interruptible_timeout(&complete,
QAT_TIMEOUT_MS)) {
status = CPA_STATUS_FAIL;
goto fail;
}
wait_for_completion(&complete);
if (dc_results.status != CPA_STATUS_SUCCESS) {
status = CPA_STATUS_FAIL;