compress/isal: fix compression stream initialization

Message ID 1553593329-8075-1-git-send-email-tomaszx.cel@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series compress/isal: fix compression stream initialization |

Checks

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

Commit Message

Cel, TomaszX March 26, 2019, 9:42 a.m. UTC
  This patch fixes ISAL internal state fields initialization.

Fixes: dc49e6aa4879 ("compress/isal: add ISA-L compression functionality")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
---
 drivers/compress/isal/isal_compress_pmd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Daly, Lee March 27, 2019, 11:35 a.m. UTC | #1
Hi Tomasz,

> -----Original Message-----
> From: Cel, TomaszX
> Sent: Tuesday, March 26, 2019 9:42 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Daly, Lee
> <lee.daly@intel.com>; Tucker, Greg B <greg.b.tucker@intel.com>; Jozwiak,
> TomaszX <tomaszx.jozwiak@intel.com>
> Subject: [PATCH] compress/isal: fix compression stream initialization
> 
> This patch fixes ISAL internal state fields initialization.
> 
> Fixes: dc49e6aa4879 ("compress/isal: add ISA-L compression functionality")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
> ---
>  drivers/compress/isal/isal_compress_pmd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/compress/isal/isal_compress_pmd.c
> b/drivers/compress/isal/isal_compress_pmd.c
> index 8879a42..1e518b3 100644
> --- a/drivers/compress/isal/isal_compress_pmd.c
> +++ b/drivers/compress/isal/isal_compress_pmd.c
> @@ -412,7 +412,7 @@ process_isal_deflate(struct rte_comp_op *op, struct
> isal_comp_qp *qp,
>  	uint8_t *temp_level_buf = qp->stream->level_buf;
> 
>  	/* Initialize compression stream */
> -	isal_deflate_stateless_init(qp->stream);
> +	isal_deflate_init(qp->stream);
> 
>  	qp->stream->level_buf = temp_level_buf;
> 
> @@ -514,8 +514,6 @@ process_isal_deflate(struct rte_comp_op *op, struct
> isal_comp_qp *qp,
>  		op->output_chksum = qp->stream->internal_state.crc;
>  	}
> 
> -	isal_deflate_reset(qp->stream);
I have tested this and it works, removing this reset function makes sense as everything cleared here is cleared in the init function anyway,
On that note, the same is to be said to isal_inflate_reset, everything cleared in reset is cleared, plus more, in isal_inflate_init.
I suggest we also remove isal_inflate_reset for commonality across both functions.

> -
>  	return ret;
>  }
> 
> --
> 2.7.4
  
Cel, TomaszX March 27, 2019, 5:46 p.m. UTC | #2
v2:
- removed isal_inflate_reset() function because is not neccesary,
  everything is cleared by the isal_inflate_init function at the begining

Tomasz Cel (1):
  compress/isal: fix compression stream initialization

 drivers/compress/isal/isal_compress_pmd.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Patch

diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c
index 8879a42..1e518b3 100644
--- a/drivers/compress/isal/isal_compress_pmd.c
+++ b/drivers/compress/isal/isal_compress_pmd.c
@@ -412,7 +412,7 @@  process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
 	uint8_t *temp_level_buf = qp->stream->level_buf;
 
 	/* Initialize compression stream */
-	isal_deflate_stateless_init(qp->stream);
+	isal_deflate_init(qp->stream);
 
 	qp->stream->level_buf = temp_level_buf;
 
@@ -514,8 +514,6 @@  process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
 		op->output_chksum = qp->stream->internal_state.crc;
 	}
 
-	isal_deflate_reset(qp->stream);
-
 	return ret;
 }