compress/isal: add appropriate flag on overflow

Message ID 1548343153-62336-1-git-send-email-lee.daly@intel.com
State New
Delegated to: akhil goyal
Headers show
Series
  • compress/isal: add appropriate flag on overflow
Related show

Checks

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

Commit Message

Daly, Lee Jan. 24, 2019, 3:19 p.m.
This patch will change the operation status when ISA-L returns because
of a recoverable out of space error, rather than a just generic fail.

Signed-off-by: Lee Daly <lee.daly@intel.com>
---
 drivers/compress/isal/isal_compress_pmd.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

Patch

diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c
index 4748238..19c4d70 100644
--- a/drivers/compress/isal/isal_compress_pmd.c
+++ b/drivers/compress/isal/isal_compress_pmd.c
@@ -348,12 +348,6 @@  chained_mbuf_decompression(struct rte_comp_op *op, struct isal_comp_qp *qp)
 
 		ret = isal_inflate(qp->state);
 
-		if (ret != ISAL_DECOMP_OK) {
-			ISAL_PMD_LOG(ERR, "Decompression operation failed\n");
-			op->status = RTE_COMP_OP_STATUS_ERROR;
-			return ret;
-		}
-
 		/* Check for first segment, offset needs to be accounted for */
 		if (remaining_data == op->src.length) {
 			consumed_data = src->data_len - src_remaining_offset;
@@ -374,6 +368,20 @@  chained_mbuf_decompression(struct rte_comp_op *op, struct isal_comp_qp *qp)
 			}
 		}
 
+		if (ret == ISAL_OUT_OVERFLOW) {
+			ISAL_PMD_LOG(ERR, "Decompression operation ran "
+				"out of space, but can be recovered.\n%d bytes "
+				"consumed\t%d bytes produced\n",
+				consumed_data, qp->state->total_out);
+				op->status =
+				RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE;
+			return ret;
+		} else if (ret < 0) {
+			ISAL_PMD_LOG(ERR, "Decompression operation failed\n");
+			op->status = RTE_COMP_OP_STATUS_ERROR;
+			return ret;
+		}
+
 		if (qp->state->avail_out == 0 &&
 				qp->state->block_state != ISAL_BLOCK_FINISH) {
 			if (dst->next != NULL) {