From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A746A3168 for ; Wed, 16 Oct 2019 11:41:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C79B1E8F9; Wed, 16 Oct 2019 11:40:55 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8CEE11E8BC for ; Wed, 16 Oct 2019 11:40:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 02:40:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="279476713" Received: from atrybulx-mobl.ger.corp.intel.com (HELO build-VirtualBox.isw.intel.com) ([10.103.104.115]) by orsmga001.jf.intel.com with ESMTP; 16 Oct 2019 02:40:50 -0700 From: Artur Trybula To: dev@dpdk.org, fiona.trahe@intel.com, shallyv@marvell.com, adamx.dybkowski@intel.com, arturx.trybula@intel.com, akhil.goyal@nxp.com Date: Wed, 16 Oct 2019 11:40:44 +0200 Message-Id: <20191016094045.19895-2-arturx.trybula@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191016094045.19895-1-arturx.trybula@intel.com> References: <20191011174613.4770-1-arturx.trybula@intel.com> <20191016094045.19895-1-arturx.trybula@intel.com> Subject: [dpdk-dev] [PATCH v4 1/2] compress/qat: overflow catch for stateless compression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds out-of-space recoverable feature for stateless compression scenario to QuickAssist compressdev driver Signed-off-by: Artur Trybula --- drivers/compress/qat/qat_comp.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index 8717b7432..533e34f6b 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -324,10 +324,32 @@ qat_comp_process_response(void **op, uint8_t *resp, void *op_cookie, (!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 = + xlat_err_code == ERR_CODE_OVERFLOW_ERROR)){ + + struct icp_qat_fw_resp_comp_pars *comp_resp = + (struct icp_qat_fw_resp_comp_pars *)&resp_msg->comp_resp_pars; + + /* handle recoverable out-of-buffer condition */ + /* in stateless compression scenario */ + if (comp_resp->input_byte_counter) { + if ((qat_xform->qat_comp_request_type + == QAT_COMP_REQUEST_FIXED_COMP_STATELESS) || + (qat_xform->qat_comp_request_type + == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)) { + + rx_op->status = + RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE; + rx_op->consumed = + comp_resp->input_byte_counter; + rx_op->produced = + comp_resp->output_byte_counter; + } else + rx_op->status = + RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED; + } else + rx_op->status = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED; - else + } else rx_op->status = RTE_COMP_OP_STATUS_ERROR; ++(*dequeue_err_count); -- 2.17.1