compress/qat: fix status return on error building request

Message ID 1544786371-29799-2-git-send-email-tomaszx.jozwiak@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series compress/qat: fix status return on error building request |

Checks

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

Commit Message

Tomasz Jozwiak Dec. 14, 2018, 11:19 a.m. UTC
  This patch fixes error status which should be set inside
qat_comp_build_request function in case any errors are detected.
In these cases op.status is set to
RTE_COMP_OP_STATUS_INVALID_ARGS to help application debug.

Fixes: 1947bd18580b ("compress/qat: support scatter-gather buffers")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/compress/qat/qat_comp.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Fiona Trahe Dec. 14, 2018, 6:48 p.m. UTC | #1
> -----Original Message-----
> From: Jozwiak, TomaszX
> Sent: Friday, December 14, 2018 4:20 AM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; akhil.goyal@nxp.com; stable@dpdk.org
> Subject: [PATCH] compress/qat: fix status return on error building request
> 
> This patch fixes error status which should be set inside
> qat_comp_build_request function in case any errors are detected.
> In these cases op.status is set to
> RTE_COMP_OP_STATUS_INVALID_ARGS to help application debug.
> 
> Fixes: 1947bd18580b ("compress/qat: support scatter-gather buffers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
  
Akhil Goyal Dec. 18, 2018, 10:32 a.m. UTC | #2
On 12/15/2018 12:18 AM, Trahe, Fiona wrote:
>
>> -----Original Message-----
>> From: Jozwiak, TomaszX
>> Sent: Friday, December 14, 2018 4:20 AM
>> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
>> <tomaszx.jozwiak@intel.com>; akhil.goyal@nxp.com; stable@dpdk.org
>> Subject: [PATCH] compress/qat: fix status return on error building request
>>
>> This patch fixes error status which should be set inside
>> qat_comp_build_request function in case any errors are detected.
>> In these cases op.status is set to
>> RTE_COMP_OP_STATUS_INVALID_ARGS to help application debug.
>>
>> Fixes: 1947bd18580b ("compress/qat: support scatter-gather buffers")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Applied to dpdk-next-crypto

Thanks
  
De Lara Guarch, Pablo Jan. 9, 2019, 10:43 p.m. UTC | #3
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Trahe, Fiona
> Sent: Friday, December 14, 2018 6:48 PM
> To: Jozwiak, TomaszX <tomaszx.jozwiak@intel.com>; dev@dpdk.org;
> akhil.goyal@nxp.com; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] compress/qat: fix status return on error
> building request
> 
> 
> 
> > -----Original Message-----
> > From: Jozwiak, TomaszX
> > Sent: Friday, December 14, 2018 4:20 AM
> > To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak,
> > TomaszX <tomaszx.jozwiak@intel.com>; akhil.goyal@nxp.com;
> > stable@dpdk.org
> > Subject: [PATCH] compress/qat: fix status return on error building
> > request
> >
> > This patch fixes error status which should be set inside
> > qat_comp_build_request function in case any errors are detected.
> > In these cases op.status is set to
> > RTE_COMP_OP_STATUS_INVALID_ARGS to help application debug.
> >
> > Fixes: 1947bd18580b ("compress/qat: support scatter-gather buffers")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Applied to dpdk-next-crypto.

Thanks,
Pablo
  

Patch

diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 2754742..8a6fad0 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -36,6 +36,7 @@  qat_comp_build_request(void *in_op, uint8_t *out_msg,
 		QAT_DP_LOG(ERR, "QAT PMD only supports stateless compression "
 				"operation requests, op (%p) is not a "
 				"stateless operation.", op);
+		op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
 		return -EINVAL;
 	}
 
@@ -61,6 +62,7 @@  qat_comp_build_request(void *in_op, uint8_t *out_msg,
 				RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS);
 		if (ret) {
 			QAT_DP_LOG(ERR, "QAT PMD Cannot fill source sgl array");
+			op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
 			return ret;
 		}
 
@@ -71,6 +73,7 @@  qat_comp_build_request(void *in_op, uint8_t *out_msg,
 				RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS);
 		if (ret) {
 			QAT_DP_LOG(ERR, "QAT PMD Cannot fill dest. sgl array");
+			op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
 			return ret;
 		}