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 84811A00C5; Thu, 7 May 2020 10:30:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBBFE1DAB7; Thu, 7 May 2020 10:30:41 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4A3FC1DA45 for ; Thu, 7 May 2020 10:30:40 +0200 (CEST) IronPort-SDR: uWsIGlkEM399py6VbplYrbvYyGEuLToVbOuKSrzOEwLXHEz+Z9S/Gp5oJbYKMrUBXhFlENNvx3 XEjsbK0WZwFQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 01:30:37 -0700 IronPort-SDR: at+BON7p9yhsnCF+RW1qpVzhB0lg/lRuafZPXG5I56YM5xkpg3q8Ho/GPkI/XtXXYbjKCMDbex DFA8DY3fqpDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,363,1583222400"; d="scan'208";a="305052930" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 07 May 2020 01:30:37 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 7 May 2020 01:30:37 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 7 May 2020 16:30:35 +0800 Received: from shsmsx602.ccr.corp.intel.com ([10.109.6.142]) by SHSMSX602.ccr.corp.intel.com ([10.109.6.142]) with mapi id 15.01.1713.004; Thu, 7 May 2020 16:30:35 +0800 From: "Zhao, XinfengX" To: "dev@dpdk.org" CC: "Dybkowski, AdamX" Thread-Topic: [dpdk-dev] [PATCH] common/qat: fix queue head update Thread-Index: AQHWIvMUKtBQc7nvaEm6cBg+3EygOqicTWog Date: Thu, 7 May 2020 08:30:35 +0000 Message-ID: References: <20200505153037.30840-1-adamx.dybkowski@intel.com> In-Reply-To: <20200505153037.30840-1-adamx.dybkowski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Tested-by: Zhao, Xinfeng -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adam Dybkowski Sent: Tuesday, May 5, 2020 11:31 PM To: dev@dpdk.org; Trahe, Fiona Cc: Dybkowski, AdamX Subject: [dpdk-dev] [PATCH] common/qat: fix queue head update This patch fixes missing queue head update that occured when a multiple-req= uest 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 --- 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 inde= x 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 =3D 0, fw_resp_counter =3D 0; uint8_t *resp_msg; - int nb_fw_responses =3D 0; + int nb_fw_responses; =20 rx_queue =3D &(tmp_qp->rx_q); head =3D rx_queue->head; @@ -840,24 +840,20 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t n= b_ops) while (*(uint32_t *)resp_msg !=3D ADF_RING_EMPTY_SIG && op_resp_counter !=3D nb_ops) { =20 - nb_fw_responses =3D 0; - if (tmp_qp->service_type =3D=3D QAT_SERVICE_SYMMETRIC) { - qat_sym_process_response(ops, resp_msg); - nb_fw_responses =3D 1; - } else if (tmp_qp->service_type =3D=3D QAT_SERVICE_COMPRESSION) + nb_fw_responses =3D 1; =20 + if (tmp_qp->service_type =3D=3D QAT_SERVICE_SYMMETRIC) + qat_sym_process_response(ops, resp_msg); + else if (tmp_qp->service_type =3D=3D QAT_SERVICE_COMPRESSION) nb_fw_responses =3D 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 =3D=3D QAT_SERVICE_ASYMMETRIC) { #ifdef BUILD_QAT_ASYM + else if (tmp_qp->service_type =3D=3D QAT_SERVICE_ASYMMETRIC) qat_asym_process_response(ops, resp_msg, tmp_qp->op_cookies[head >> rx_queue->trailz]); - nb_fw_responses =3D 1; #endif - } =20 head =3D 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 n= b_ops) * finished with all firmware responses. */ fw_resp_counter +=3D nb_fw_responses; + + rx_queue->nb_processed_responses++; } =20 - if (fw_resp_counter > 0) { - rx_queue->head =3D head; - tmp_qp->dequeued +=3D fw_resp_counter; - tmp_qp->stats.dequeued_count +=3D fw_resp_counter; - rx_queue->nb_processed_responses +=3D fw_resp_counter; + tmp_qp->dequeued +=3D fw_resp_counter; + tmp_qp->stats.dequeued_count +=3D fw_resp_counter; + + rx_queue->head =3D head; + if (rx_queue->nb_processed_responses > QAT_CSR_HEAD_WRITE_THRESH) + rxq_free_desc(tmp_qp, rx_queue); =20 - 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); =20 -- 2.17.1