From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2601C1B10E; Thu, 1 Nov 2018 12:48:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 04:48:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,451,1534834800"; d="scan'208";a="270558151" Received: from silpixa00399501.ir.intel.com ([10.237.223.69]) by orsmga005.jf.intel.com with ESMTP; 01 Nov 2018 04:48:24 -0700 From: Lee Daly To: akhil.goyal@nxp.com, fiona.trahe@intel.com Cc: dev@dpdk.org, Lee Daly , stable@dpdk.org Date: Thu, 1 Nov 2018 11:48:19 +0000 Message-Id: <1541072899-112029-1-git-send-email-lee.daly@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] compress/isal: fix uncleared compression states X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 11:48:27 -0000 Fixing uncleared states of compression & decompression engines post op. Fixes: 788e748d3845 ("compress/isal: support chained mbufs") Fixes: dc49e6aa4879 ("compress/isal: add ISA-L compression functionality") Fixes: 7bf4f0630af6 ("compress/isal: add ISA-L decomp functionality") Cc: stable@dpdk.org Signed-off-by: Lee Daly --- drivers/compress/isal/isal_compress_pmd.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c index e943336..9f1e968 100644 --- a/drivers/compress/isal/isal_compress_pmd.c +++ b/drivers/compress/isal/isal_compress_pmd.c @@ -314,24 +314,23 @@ chained_mbuf_decompression(struct rte_comp_op *op, struct isal_comp_qp *qp) ret = isal_inflate(qp->state); - /* Check for first segment, offset needs to be accounted for */ - if (remaining_data == op->src.length) { - consumed_data = src->data_len - qp->state->avail_in - - src_remaining_offset; - } else - consumed_data = src->data_len - qp->state->avail_in; - - op->consumed += consumed_data; - remaining_data -= consumed_data; - 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; + } else + consumed_data = src->data_len; + if (qp->state->avail_in == 0 && op->consumed != op->src.length) { + op->consumed += consumed_data; + remaining_data -= consumed_data; + if (src->next != NULL) { src = src->next; qp->state->next_in = @@ -460,8 +459,9 @@ process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp, return ret; } } - op->consumed = qp->stream->total_in; - op->produced = qp->stream->total_out; + op->consumed = qp->stream->total_in; + op->produced = qp->stream->total_out; + isal_deflate_reset(qp->stream); return ret; } @@ -538,6 +538,7 @@ process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp) op->consumed = op->src.length - qp->state->avail_in; } op->produced = qp->state->total_out; + isal_inflate_reset(qp->state); return ret; } -- 2.7.4