compress/qat: fix return on building request error
authorTomasz Jozwiak <tomaszx.jozwiak@intel.com>
Fri, 14 Dec 2018 11:19:31 +0000 (12:19 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 19 Dec 2018 10:19:10 +0000 (11:19 +0100)
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>
drivers/compress/qat/qat_comp.c

index 2754742..8a6fad0 100644 (file)
@@ -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;
                }