compress/isal: fix compression stream initialization
Checks
Commit Message
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
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
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(-)
@@ -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;
}