From patchwork Tue May 5 15:30:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dybkowski, AdamX" X-Patchwork-Id: 69765 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B1FC5A04B8; Tue, 5 May 2020 17:36:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5F4A1D627; Tue, 5 May 2020 17:36:44 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 4FE4C1D614 for ; Tue, 5 May 2020 17:36:42 +0200 (CEST) IronPort-SDR: XVh31LO/Mm/8hqByHJAi8xLBZERMC1iyOzq4A/WpwlVzJOL/qBrET5I0AWT6KjzSYyPsNY5+DX W8iHTwqFTbxQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 08:36:40 -0700 IronPort-SDR: yOwa2ejLh/PXLBM9vrX+BfU9ZJyh6juhTxZGof9Grn0856aKCvBI3bWJUKzAcZzqTux+aNAXSA 7e9twRQM+E9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,355,1583222400"; d="scan'208";a="277914719" Received: from adamdybx-mobl.ger.corp.intel.com (HELO addy-VirtualBox.ger.corp.intel.com) ([10.104.125.117]) by orsmga002.jf.intel.com with ESMTP; 05 May 2020 08:36:38 -0700 From: Adam Dybkowski To: dev@dpdk.org, fiona.trahe@intel.com Cc: Adam Dybkowski Date: Tue, 5 May 2020 17:30:37 +0200 Message-Id: <20200505153037.30840-1-adamx.dybkowski@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] common/qat: fix queue head update 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 fixes missing queue head update that occured when a multiple-request dynamic Huffman compression operation was not complete within one qat_dequeue_op_burst function call. Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation") Signed-off-by: Adam Dybkowski Acked-by: Fiona Trahe Tested-by: Zhao, Xinfeng Signed-off-by: Adam Dybkowski --- drivers/common/qat/qat_qp.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index 64dfd85c4..098b99786 100644 --- a/drivers/common/qat/qat_qp.c +++ b/drivers/common/qat/qat_qp.c @@ -831,7 +831,7 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops) uint32_t head; uint32_t op_resp_counter = 0, fw_resp_counter = 0; uint8_t *resp_msg; - int nb_fw_responses = 0; + int nb_fw_responses; rx_queue = &(tmp_qp->rx_q); head = rx_queue->head; @@ -840,24 +840,20 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops) while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG && op_resp_counter != nb_ops) { - nb_fw_responses = 0; - if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC) { - qat_sym_process_response(ops, resp_msg); - nb_fw_responses = 1; - } else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION) + nb_fw_responses = 1; + if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC) + qat_sym_process_response(ops, resp_msg); + else if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION) nb_fw_responses = qat_comp_process_response( ops, resp_msg, tmp_qp->op_cookies[head >> rx_queue->trailz], &tmp_qp->stats.dequeue_err_count); - - else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC) { #ifdef BUILD_QAT_ASYM + else if (tmp_qp->service_type == QAT_SERVICE_ASYMMETRIC) qat_asym_process_response(ops, resp_msg, tmp_qp->op_cookies[head >> rx_queue->trailz]); - nb_fw_responses = 1; #endif - } head = adf_modulo(head + rx_queue->msg_size, rx_queue->modulo_mask); @@ -879,18 +875,17 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops) * finished with all firmware responses. */ fw_resp_counter += nb_fw_responses; + + rx_queue->nb_processed_responses++; } - if (fw_resp_counter > 0) { - rx_queue->head = head; - tmp_qp->dequeued += fw_resp_counter; - tmp_qp->stats.dequeued_count += fw_resp_counter; - rx_queue->nb_processed_responses += fw_resp_counter; + tmp_qp->dequeued += fw_resp_counter; + tmp_qp->stats.dequeued_count += fw_resp_counter; + + rx_queue->head = head; + if (rx_queue->nb_processed_responses > QAT_CSR_HEAD_WRITE_THRESH) + rxq_free_desc(tmp_qp, rx_queue); - if (rx_queue->nb_processed_responses > - QAT_CSR_HEAD_WRITE_THRESH) - rxq_free_desc(tmp_qp, rx_queue); - } QAT_DP_LOG(DEBUG, "Dequeue burst return: %u, QAT responses: %u", op_resp_counter, fw_resp_counter);