From patchwork Fri Dec 14 12:11:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Jozwiak X-Patchwork-Id: 48855 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7B8E1BA64; Fri, 14 Dec 2018 13:15:50 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3DC191BA5D; Fri, 14 Dec 2018 13:15:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2018 04:15:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,352,1539673200"; d="scan'208";a="129934413" Received: from tjozwiax-mobl.ger.corp.intel.com (HELO tojo-Virtual-Machine.mshome.net) ([10.103.104.47]) by fmsmga001.fm.intel.com with ESMTP; 14 Dec 2018 04:15:46 -0800 From: Tomasz Jozwiak To: dev@dpdk.org, fiona.trahe@intel.com, tomaszx.jozwiak@intel.com, akhil.goyal@nxp.com, stable@dpdk.org Date: Fri, 14 Dec 2018 13:11:47 +0100 Message-Id: <1544789507-31067-1-git-send-email-tomaszx.jozwiak@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] compress/qat: fix error counter in dequeue errors 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 increments error counter (stats.dequeue_err_count) in case of any error detection during qat_comp_process_response function. Fixes: 3cc14fc48e35 ("compress/qat: check that correct firmware is in use") Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response") Cc: stable@dpdk.org Signed-off-by: Tomasz Jozwiak Acked-by: Fiona Trahe --- drivers/common/qat/qat_qp.c | 6 ++++-- drivers/common/qat/qat_qp.h | 3 ++- drivers/compress/qat/qat_comp.c | 4 +++- drivers/compress/qat/qat_comp.h | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index 79f6a01..f0386ac 100644 --- a/drivers/common/qat/qat_qp.c +++ b/drivers/common/qat/qat_qp.c @@ -654,7 +654,8 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops) if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC) qat_sym_process_response(ops, resp_msg); else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION) - qat_comp_process_response(ops, resp_msg); + qat_comp_process_response(ops, resp_msg, + &tmp_qp->stats.dequeue_err_count); head = adf_modulo(head + rx_queue->msg_size, rx_queue->modulo_mask); @@ -682,7 +683,8 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops) } __rte_weak int -qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused) +qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused, + uint64_t *dequeue_err_count __rte_unused) { return 0; } diff --git a/drivers/common/qat/qat_qp.h b/drivers/common/qat/qat_qp.h index 6f1525e..9833bcb 100644 --- a/drivers/common/qat/qat_qp.h +++ b/drivers/common/qat/qat_qp.h @@ -107,6 +107,7 @@ qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data, /* Needed for weak function*/ int -qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused); +qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused, + uint64_t *dequeue_err_count); #endif /* _QAT_QP_H_ */ diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index 2754742..342d2f7 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -106,7 +106,7 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, } int -qat_comp_process_response(void **op, uint8_t *resp) +qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count) { struct icp_qat_fw_comp_resp *resp_msg = (struct icp_qat_fw_comp_resp *)resp; @@ -132,6 +132,7 @@ qat_comp_process_response(void **op, uint8_t *resp) rx_op->debug_status = ERR_CODE_QAT_COMP_WRONG_FW; *op = (void *)rx_op; QAT_DP_LOG(ERR, "QAT has wrong firmware"); + ++(*dequeue_err_count); return 0; } } @@ -149,6 +150,7 @@ qat_comp_process_response(void **op, uint8_t *resp) QAT_DP_LOG(ERR, "QAT intermediate buffer may be too " "small for output, try configuring a larger size"); + ++(*dequeue_err_count); rx_op->status = RTE_COMP_OP_STATUS_ERROR; rx_op->debug_status = *((uint16_t *)(&resp_msg->comn_resp.comn_error)); diff --git a/drivers/compress/qat/qat_comp.h b/drivers/compress/qat/qat_comp.h index 99a4462..19f48df 100644 --- a/drivers/compress/qat/qat_comp.h +++ b/drivers/compress/qat/qat_comp.h @@ -60,8 +60,8 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, void *op_cookie, enum qat_device_gen qat_dev_gen __rte_unused); int -qat_comp_process_response(void **op, uint8_t *resp); - +qat_comp_process_response(void **op, uint8_t *resp, + uint64_t *dequeue_err_count); int qat_comp_private_xform_create(struct rte_compressdev *dev,