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 3F757A04B0 for ; Fri, 7 Aug 2020 14:59:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35C7B1C031; Fri, 7 Aug 2020 14:59:53 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 57D831C031 for ; Fri, 7 Aug 2020 14:59:51 +0200 (CEST) IronPort-SDR: WwhvsnP70Z+1+YV2Nx2ACis53G7BtWZPppgdcqkyHkUISZkebkdJMGim1ifD9v5u1cNSmZECYh GxeFcEvhIP4A== X-IronPort-AV: E=McAfee;i="6000,8403,9705"; a="132628751" X-IronPort-AV: E=Sophos;i="5.75,445,1589266800"; d="scan'208";a="132628751" 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; 07 Aug 2020 05:59:50 -0700 IronPort-SDR: GFIisNJvg5h0fNkM8tI3U0Eol9bXW9/KYd/F2vlMF2wwWMjugtVwQ21j94oDYZUDrv0DU46EHC lItXVVXtUlvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,445,1589266800"; d="scan'208";a="307368552" Received: from akusztax-mobl1.ger.corp.intel.com ([10.104.121.21]) by orsmga002.jf.intel.com with ESMTP; 07 Aug 2020 05:59:48 -0700 From: Arek Kusztal To: fiona.trahe@intel.com Cc: stable@dpdk.org, Arek Kusztal Date: Fri, 7 Aug 2020 14:56:59 +0200 Message-Id: <20200807125701.1764-2-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200807125701.1764-1-arkadiuszx.kusztal@intel.com> References: <20200807125701.1764-1-arkadiuszx.kusztal@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [19.11 2/4] common/qat: move max inflights param into qp 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Fiona Trahe [ upstream commit 8f185e7c3e651eb845bd82f7ab0bbb862cc0a2e2 ] The max_inflights parameter is moved from qat_queue to qat_qp as it's a more appropriate location. Cc: stable@dpdk.org Signed-off-by: Fiona Trahe Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe --- drivers/common/qat/qat_qp.c | 23 ++++++++++++----------- drivers/common/qat/qat_qp.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index d189fc3..791c469 100644 --- a/drivers/common/qat/qat_qp.c +++ b/drivers/common/qat/qat_qp.c @@ -242,6 +242,15 @@ int qat_qp_setup(struct qat_pci_device *qat_dev, goto create_err; } + qp->max_inflights = ADF_MAX_INFLIGHTS(qp->tx_q.queue_size, + ADF_BYTES_TO_MSG_SIZE(qp->tx_q.msg_size)); + + if (qp->max_inflights < 2) { + QAT_LOG(ERR, "Invalid num inflights"); + qat_queue_delete(&(qp->tx_q)); + goto create_err; + } + if (qat_queue_create(qat_dev, &(qp->rx_q), qat_qp_conf, ADF_RING_DIR_RX) != 0) { QAT_LOG(ERR, "Rx queue create failed " @@ -420,15 +429,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue, goto queue_create_err; } - queue->max_inflights = ADF_MAX_INFLIGHTS(queue->queue_size, - ADF_BYTES_TO_MSG_SIZE(desc_size)); queue->modulo_mask = (1 << ADF_RING_SIZE_MODULO(queue->queue_size)) - 1; - - if (queue->max_inflights < 2) { - QAT_LOG(ERR, "Invalid num inflights"); - ret = -EINVAL; - goto queue_create_err; - } queue->head = 0; queue->tail = 0; queue->msg_size = desc_size; @@ -447,11 +448,11 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue, queue->hw_queue_number, queue_base); QAT_LOG(DEBUG, "RING: Name:%s, size in CSR: %u, in bytes %u," - " nb msgs %u, msg_size %u, max_inflights %u modulo mask %u", + " nb msgs %u, msg_size %u, modulo mask %u", queue->memz_name, queue->queue_size, queue_size_bytes, qp_conf->nb_descriptors, desc_size, - queue->max_inflights, queue->modulo_mask); + queue->modulo_mask); return 0; @@ -594,7 +595,7 @@ qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops) /* Find how many can actually fit on the ring */ tmp_qp->inflights16 += nb_ops; - overflow = tmp_qp->inflights16 - queue->max_inflights; + overflow = tmp_qp->inflights16 - tmp_qp->max_inflights; if (overflow > 0) { tmp_qp->inflights16 -= overflow; nb_ops_possible = nb_ops - overflow; diff --git a/drivers/common/qat/qat_qp.h b/drivers/common/qat/qat_qp.h index a9a0184..02a613a 100644 --- a/drivers/common/qat/qat_qp.h +++ b/drivers/common/qat/qat_qp.h @@ -51,7 +51,6 @@ struct qat_queue { uint32_t tail; /* Shadow copy of the tail */ uint32_t modulo_mask; uint32_t msg_size; - uint16_t max_inflights; uint32_t queue_size; uint8_t hw_bundle_number; uint8_t hw_queue_number; @@ -76,6 +75,7 @@ struct qat_qp { enum qat_service_type service_type; struct qat_pci_device *qat_dev; /**< qat device this qp is on */ + uint16_t max_inflights; } __rte_cache_aligned; extern const struct qat_qp_hw_data qat_gen1_qps[][ADF_MAX_QPS_ON_ANY_SERVICE]; -- 2.1.0