DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] compress/isal: fix uncleared compression states
@ 2018-11-01 11:48 Lee Daly
  2018-11-02 11:35 ` Akhil Goyal
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Daly @ 2018-11-01 11:48 UTC (permalink / raw)
  To: akhil.goyal, fiona.trahe; +Cc: dev, Lee Daly, stable

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 <lee.daly@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix uncleared compression states
  2018-11-01 11:48 [dpdk-dev] [PATCH] compress/isal: fix uncleared compression states Lee Daly
@ 2018-11-02 11:35 ` Akhil Goyal
  0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2018-11-02 11:35 UTC (permalink / raw)
  To: Lee Daly, fiona.trahe; +Cc: dev, stable



On 11/1/2018 5:18 PM, Lee Daly wrote:
> 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 <lee.daly@intel.com>
> ---
>
Applied to dpdk-next-crypto

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-02 11:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 11:48 [dpdk-dev] [PATCH] compress/isal: fix uncleared compression states Lee Daly
2018-11-02 11:35 ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).