* [dpdk-dev] [PATCH] compress/qat: fix return correct status on qat overflow
@ 2018-12-21 9:12 Tomasz Jozwiak
2018-12-27 10:42 ` [dpdk-dev] [PATCH v2] " Tomasz Jozwiak
0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Jozwiak @ 2018-12-21 9:12 UTC (permalink / raw)
To: dev, fiona.trahe, tomaszx.jozwiak, akhil.goyal, stable
This patch fixes correct status in case of overflow on
QAT is detected.
In that case RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED value is set in
rte_comp_op.status field instead of RTE_COMP_OP_STATUS_ERROR
Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
drivers/compress/qat/qat_comp.c | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index bb00610..4edf4c8 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -117,6 +117,9 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count)
(resp_msg->opaque_data);
struct qat_comp_xform *qat_xform = (struct qat_comp_xform *)
(rx_op->private_xform);
+ int err = resp_msg->comn_resp.comn_status &
+ ((1 << QAT_COMN_RESP_CMP_STATUS_BITPOS) |
+ (1 << QAT_COMN_RESP_XLAT_STATUS_BITPOS));
#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
QAT_DP_LOG(DEBUG, "Direction: %s",
@@ -140,21 +143,30 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count)
}
}
- if ((ICP_QAT_FW_COMN_RESP_CMP_STAT_GET(resp_msg->comn_resp.comn_status)
- | ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
- resp_msg->comn_resp.comn_status)) !=
- ICP_QAT_FW_COMN_STATUS_FLAG_OK) {
-
- if (unlikely((ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
- resp_msg->comn_resp.comn_status) !=
- ICP_QAT_FW_COMN_STATUS_FLAG_OK) &&
- (qat_xform->qat_comp_request_type
- == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)))
+ if (err) {
+ if (unlikely((err & (1 << QAT_COMN_RESP_XLAT_STATUS_BITPOS))
+ && (qat_xform->qat_comp_request_type
+ == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS))) {
QAT_DP_LOG(ERR, "QAT intermediate buffer may be too "
"small for output, try configuring a larger size");
+ }
+
+ int8_t cmp_err_code =
+ (int8_t)resp_msg->comn_resp.comn_error.cmp_err_code;
+ int8_t xlat_err_code =
+ (int8_t)resp_msg->comn_resp.comn_error.xlat_err_code;
+
+ if ((cmp_err_code == ERR_CODE_OVERFLOW_ERROR && !xlat_err_code)
+ ||
+ (!cmp_err_code && xlat_err_code == ERR_CODE_OVERFLOW_ERROR)
+ ||
+ ((cmp_err_code | xlat_err_code) == ERR_CODE_OVERFLOW_ERROR))
+ rx_op->status =
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
+ else
+ rx_op->status = RTE_COMP_OP_STATUS_ERROR;
++(*dequeue_err_count);
- rx_op->status = RTE_COMP_OP_STATUS_ERROR;
rx_op->debug_status =
*((uint16_t *)(&resp_msg->comn_resp.comn_error));
} else {
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] compress/qat: fix return correct status on qat overflow
2018-12-21 9:12 [dpdk-dev] [PATCH] compress/qat: fix return correct status on qat overflow Tomasz Jozwiak
@ 2018-12-27 10:42 ` Tomasz Jozwiak
2018-12-27 10:42 ` Tomasz Jozwiak
0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Jozwiak @ 2018-12-27 10:42 UTC (permalink / raw)
To: dev, fiona.trahe, tomaszx.jozwiak, akhil.goyal, stable
v2 changes:
- Fixed wrong condition
Tomasz Jozwiak (1):
compress/qat: fix return correct status on qat overflow
drivers/compress/qat/qat_comp.c | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] compress/qat: fix return correct status on qat overflow
2018-12-27 10:42 ` [dpdk-dev] [PATCH v2] " Tomasz Jozwiak
@ 2018-12-27 10:42 ` Tomasz Jozwiak
2019-01-08 16:45 ` Trahe, Fiona
0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Jozwiak @ 2018-12-27 10:42 UTC (permalink / raw)
To: dev, fiona.trahe, tomaszx.jozwiak, akhil.goyal, stable
This patch fixes correct status in case of overflow on
QAT is detected.
In that case RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED value is set in
rte_comp_op.status field instead of RTE_COMP_OP_STATUS_ERROR
Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
drivers/compress/qat/qat_comp.c | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index bb00610..450cfd6 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -117,6 +117,9 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count)
(resp_msg->opaque_data);
struct qat_comp_xform *qat_xform = (struct qat_comp_xform *)
(rx_op->private_xform);
+ int err = resp_msg->comn_resp.comn_status &
+ ((1 << QAT_COMN_RESP_CMP_STATUS_BITPOS) |
+ (1 << QAT_COMN_RESP_XLAT_STATUS_BITPOS));
#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
QAT_DP_LOG(DEBUG, "Direction: %s",
@@ -140,21 +143,31 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count)
}
}
- if ((ICP_QAT_FW_COMN_RESP_CMP_STAT_GET(resp_msg->comn_resp.comn_status)
- | ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
- resp_msg->comn_resp.comn_status)) !=
- ICP_QAT_FW_COMN_STATUS_FLAG_OK) {
-
- if (unlikely((ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
- resp_msg->comn_resp.comn_status) !=
- ICP_QAT_FW_COMN_STATUS_FLAG_OK) &&
- (qat_xform->qat_comp_request_type
- == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)))
+ if (err) {
+ if (unlikely((err & (1 << QAT_COMN_RESP_XLAT_STATUS_BITPOS))
+ && (qat_xform->qat_comp_request_type
+ == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS))) {
QAT_DP_LOG(ERR, "QAT intermediate buffer may be too "
"small for output, try configuring a larger size");
+ }
+
+ int8_t cmp_err_code =
+ (int8_t)resp_msg->comn_resp.comn_error.cmp_err_code;
+ int8_t xlat_err_code =
+ (int8_t)resp_msg->comn_resp.comn_error.xlat_err_code;
+
+ if ((cmp_err_code == ERR_CODE_OVERFLOW_ERROR && !xlat_err_code)
+ ||
+ (!cmp_err_code && xlat_err_code == ERR_CODE_OVERFLOW_ERROR)
+ ||
+ (cmp_err_code == ERR_CODE_OVERFLOW_ERROR &&
+ xlat_err_code == ERR_CODE_OVERFLOW_ERROR))
+ rx_op->status =
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
+ else
+ rx_op->status = RTE_COMP_OP_STATUS_ERROR;
++(*dequeue_err_count);
- rx_op->status = RTE_COMP_OP_STATUS_ERROR;
rx_op->debug_status =
*((uint16_t *)(&resp_msg->comn_resp.comn_error));
} else {
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] compress/qat: fix return correct status on qat overflow
2018-12-27 10:42 ` Tomasz Jozwiak
@ 2019-01-08 16:45 ` Trahe, Fiona
0 siblings, 0 replies; 4+ messages in thread
From: Trahe, Fiona @ 2019-01-08 16:45 UTC (permalink / raw)
To: Jozwiak, TomaszX, dev, akhil.goyal, stable; +Cc: Trahe, Fiona
> -----Original Message-----
> From: Jozwiak, TomaszX
> Sent: Thursday, December 27, 2018 10:42 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 v2] compress/qat: fix return correct status on qat overflow
>
> This patch fixes correct status in case of overflow on
> QAT is detected.
> In that case RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED value is set in
> rte_comp_op.status field instead of RTE_COMP_OP_STATUS_ERROR
>
> Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-08 16:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 9:12 [dpdk-dev] [PATCH] compress/qat: fix return correct status on qat overflow Tomasz Jozwiak
2018-12-27 10:42 ` [dpdk-dev] [PATCH v2] " Tomasz Jozwiak
2018-12-27 10:42 ` Tomasz Jozwiak
2019-01-08 16:45 ` Trahe, Fiona
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).