[1/2] compress/qat: overflow catching

Message ID 20190906111138.1582-1-arturx.trybula@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series [1/2] compress/qat: overflow catching |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Artur Trybula Sept. 6, 2019, 11:11 a.m. UTC
  Out-of-space recoverable feature added to QuickAssist compressdev driver

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
---
 drivers/compress/qat/qat_comp.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 835aaa838..aa43df6b1 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -259,10 +259,29 @@  qat_comp_process_response(void **op, uint8_t *resp, void *op_cookie,
 		    (!cmp_err_code && xlat_err_code == ERR_CODE_OVERFLOW_ERROR)
 				||
 		    (cmp_err_code == ERR_CODE_OVERFLOW_ERROR &&
-		     xlat_err_code == ERR_CODE_OVERFLOW_ERROR))
-			rx_op->status =
+		     xlat_err_code == ERR_CODE_OVERFLOW_ERROR)) {
+
+			struct icp_qat_fw_resp_comp_pars *comp_resp =
+	  (struct icp_qat_fw_resp_comp_pars *)&resp_msg->comp_resp_pars;
+
+			if (comp_resp->input_byte_counter) {
+				if ((qat_xform->qat_comp_request_type
+				== QAT_COMP_REQUEST_FIXED_COMP_STATELESS) ||
+				    (qat_xform->qat_comp_request_type
+				== QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)) {
+					rx_op->status =
+				RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE;
+					rx_op->consumed =
+						comp_resp->input_byte_counter;
+					rx_op->produced =
+						comp_resp->output_byte_counter;
+				} else
+					rx_op->status =
 				RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
-		else
+			} else
+				rx_op->status =
+				RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
+		} else
 			rx_op->status = RTE_COMP_OP_STATUS_ERROR;
 
 		++(*dequeue_err_count);