From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C4C051B461 for ; Thu, 31 Jan 2019 16:49:39 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CD38394D3F; Thu, 31 Jan 2019 15:49:39 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E78E5C23F; Thu, 31 Jan 2019 15:49:37 +0000 (UTC) From: Kevin Traynor To: Tomasz Jozwiak Cc: Fiona Trahe , dpdk stable Date: Thu, 31 Jan 2019 15:48:13 +0000 Message-Id: <20190131154901.5383-5-ktraynor@redhat.com> In-Reply-To: <20190131154901.5383-1-ktraynor@redhat.com> References: <20190131154901.5383-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Jan 2019 15:49:39 +0000 (UTC) Subject: [dpdk-stable] patch 'compress/qat: fix returned status on overflow' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:49:40 -0000 Hi, FYI, your patch has been queued to LTS release 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >>From 210b4407288a9ad4d001723535610adc0559bce6 Mon Sep 17 00:00:00 2001 From: Tomasz Jozwiak Date: Thu, 27 Dec 2018 11:42:19 +0100 Subject: [PATCH] compress/qat: fix returned status on overflow [ upstream commit 3dc9ef2d23fe4787947f58758394444e677ea311 ] 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") Signed-off-by: Tomasz Jozwiak Acked-by: Fiona Trahe --- 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 bb006104f..450cfd659 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -118,4 +118,7 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count) 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 @@ -141,19 +144,29 @@ 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)); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-31 15:44:05.868608611 +0000 +++ 0005-compress-qat-fix-returned-status-on-overflow.patch 2019-01-31 15:44:05.000000000 +0000 @@ -1,15 +1,16 @@ -From 3dc9ef2d23fe4787947f58758394444e677ea311 Mon Sep 17 00:00:00 2001 +From 210b4407288a9ad4d001723535610adc0559bce6 Mon Sep 17 00:00:00 2001 From: Tomasz Jozwiak Date: Thu, 27 Dec 2018 11:42:19 +0100 Subject: [PATCH] compress/qat: fix returned status on overflow +[ upstream commit 3dc9ef2d23fe4787947f58758394444e677ea311 ] + 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 Acked-by: Fiona Trahe @@ -18,7 +19,7 @@ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c -index e745d1362..32ca753b7 100644 +index bb006104f..450cfd659 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -118,4 +118,7 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count)