[v3,1/2] compress/qat: overflow catch for stateless compression
diff mbox series

Message ID 20191011174613.4770-2-arturx.trybula@intel.com
State Superseded
Delegated to: akhil goyal
Headers show
Series
  • Add overflow recovery for stateless compression
Related show

Checks

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

Commit Message

Artur Trybula Oct. 11, 2019, 5:46 p.m. UTC
This patch adds out-of-space recoverable feature for stateless
compression scenario to QuickAssist compressdev driver

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

Comments

Trahe, Fiona Oct. 14, 2019, 1:38 p.m. UTC | #1
> -----Original Message-----
> From: Trybula, ArturX
> Sent: Friday, October 11, 2019 6:46 PM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; shallyv@marvell.com; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>; Trybula, ArturX <arturx.trybula@intel.com>; akhil.goyal@nxp.com
> Subject: [PATCH v3 1/2] compress/qat: overflow catch for stateless compression
> 
> This patch adds out-of-space recoverable feature for stateless
> compression scenario to QuickAssist compressdev driver
> 
> Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Patch
diff mbox series

diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 8717b7432..533e34f6b 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -324,10 +324,32 @@  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;
+
+			/* handle recoverable out-of-buffer condition */
+			/* in stateless compression scenario */
+			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
+				rx_op->status =
 				RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
-		else
+		} else
 			rx_op->status = RTE_COMP_OP_STATUS_ERROR;
 
 		++(*dequeue_err_count);