From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 516701CF85 for ; Fri, 6 Apr 2018 20:52:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2018 11:52:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,416,1517904000"; d="scan'208";a="189275833" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga004.jf.intel.com with ESMTP; 06 Apr 2018 11:52:55 -0700 From: Fiona Trahe To: dev@dpdk.org, pablo.de.lara.guarch@intel.com Cc: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com Date: Fri, 6 Apr 2018 19:52:08 +0100 Message-Id: <1523040732-3290-27-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1523040732-3290-1-git-send-email-fiona.trahe@intel.com> References: <1523040732-3290-1-git-send-email-fiona.trahe@intel.com> Subject: [dpdk-dev] [PATCH 26/30] crypto/qat: remove incorrect usage of bundle number 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: , X-List-Received-Date: Fri, 06 Apr 2018 18:52:58 -0000 As bundle_num is included in qat_gen1_qps static array there shouldn't be a multiplier used in qat_qps_per_service() Then removed ADF_NUM_BUNDLES_PER_DEV as no longer used. Also renamed ADF_MAX_QPS_PER_BUNDLE to ADF_MAX_QPS_ON_ANY_SERVICE and reduced from 4 to 2 which is enough for all current devices. Signed-off-by: Fiona Trahe --- .../crypto/qat/qat_adf/adf_transport_access_macros.h | 5 ++--- drivers/crypto/qat/qat_common.c | 4 ++-- drivers/crypto/qat/qat_device.h | 4 ++-- drivers/crypto/qat/qat_qp.c | 19 ++++--------------- drivers/crypto/qat/qat_qp.h | 2 +- 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h b/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h index 2136d54ab..1eef5513f 100644 --- a/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h +++ b/drivers/crypto/qat/qat_adf/adf_transport_access_macros.h @@ -50,9 +50,8 @@ #define ADF_MAX_RING_SIZE ADF_RING_SIZE_4M #define ADF_DEFAULT_RING_SIZE ADF_RING_SIZE_16K -#define ADF_NUM_BUNDLES_PER_DEV 1 -/* Maximum number of qps for any service type */ -#define ADF_MAX_QPS_PER_BUNDLE 4 +/* Maximum number of qps on a device for any service type */ +#define ADF_MAX_QPS_ON_ANY_SERVICE 2 #define ADF_RING_DIR_TX 0 #define ADF_RING_DIR_RX 1 diff --git a/drivers/crypto/qat/qat_common.c b/drivers/crypto/qat/qat_common.c index f1759ea76..5d6779757 100644 --- a/drivers/crypto/qat/qat_common.c +++ b/drivers/crypto/qat/qat_common.c @@ -67,7 +67,7 @@ void qat_stats_get(struct qat_pci_device *dev, } qp = dev->qps_in_use[service]; - for (i = 0; i < ADF_MAX_QPS_PER_BUNDLE; i++) { + for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) { if (qp[i] == NULL) { PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d", service, i); @@ -94,7 +94,7 @@ void qat_stats_reset(struct qat_pci_device *dev, } qp = dev->qps_in_use[service]; - for (i = 0; i < ADF_MAX_QPS_PER_BUNDLE; i++) { + for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) { if (qp[i] == NULL) { PMD_DRV_LOG(DEBUG, "Service %d Uninitialised qp %d", service, i); diff --git a/drivers/crypto/qat/qat_device.h b/drivers/crypto/qat/qat_device.h index fd1819354..fd20a0147 100644 --- a/drivers/crypto/qat/qat_device.h +++ b/drivers/crypto/qat/qat_device.h @@ -44,7 +44,7 @@ struct qat_pci_device { uint8_t attached : 1; /**< Flag indicating the device is attached */ - struct qat_qp *qps_in_use[QAT_MAX_SERVICES][ADF_MAX_QPS_PER_BUNDLE]; + struct qat_qp *qps_in_use[QAT_MAX_SERVICES][ADF_MAX_QPS_ON_ANY_SERVICE]; /**< links to qps set up for each service, index same as on API */ /* Data relating to symmetric crypto service */ @@ -59,7 +59,7 @@ struct qat_pci_device { struct qat_gen_hw_data { enum qat_device_gen dev_gen; - const struct qat_qp_hw_data (*qp_hw_data)[ADF_MAX_QPS_PER_BUNDLE]; + const struct qat_qp_hw_data (*qp_hw_data)[ADF_MAX_QPS_ON_ANY_SERVICE]; }; extern struct qat_gen_hw_data qp_gen_config[]; diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c index 2e12f7c82..8fbdf85b8 100644 --- a/drivers/crypto/qat/qat_qp.c +++ b/drivers/crypto/qat/qat_qp.c @@ -29,7 +29,7 @@ __extension__ const struct qat_qp_hw_data qat_gen1_qps[QAT_MAX_SERVICES] - [ADF_MAX_QPS_PER_BUNDLE] = { + [ADF_MAX_QPS_ON_ANY_SERVICE] = { /* queue pairs which provide an asymmetric crypto service */ [QAT_SERVICE_ASYMMETRIC] = { { @@ -42,14 +42,11 @@ const struct qat_qp_hw_data qat_gen1_qps[QAT_MAX_SERVICES] }, { .service_type = QAT_SERVICE_ASYMMETRIC, + .hw_bundle_num = 0, .tx_ring_num = 1, .rx_ring_num = 9, .tx_msg_size = 64, .rx_msg_size = 32, - }, { - .service_type = QAT_SERVICE_INVALID, - }, { - .service_type = QAT_SERVICE_INVALID, } }, /* queue pairs which provide a symmetric crypto service */ @@ -69,10 +66,6 @@ const struct qat_qp_hw_data qat_gen1_qps[QAT_MAX_SERVICES] .rx_ring_num = 11, .tx_msg_size = 128, .rx_msg_size = 32, - }, { - .service_type = QAT_SERVICE_INVALID, - }, { - .service_type = QAT_SERVICE_INVALID, } }, /* queue pairs which provide a compression service */ @@ -91,10 +84,6 @@ const struct qat_qp_hw_data qat_gen1_qps[QAT_MAX_SERVICES] .rx_ring_num = 15, .tx_msg_size = 128, .rx_msg_size = 32, - }, { - .service_type = QAT_SERVICE_INVALID, - }, { - .service_type = QAT_SERVICE_INVALID, } } }; @@ -118,10 +107,10 @@ int qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data, { int i, count; - for (i = 0, count = 0; i < ADF_MAX_QPS_PER_BUNDLE; i++) + for (i = 0, count = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) if (qp_hw_data[i].service_type == service) count++; - return count * ADF_NUM_BUNDLES_PER_DEV; + return count; } static const struct rte_memzone * diff --git a/drivers/crypto/qat/qat_qp.h b/drivers/crypto/qat/qat_qp.h index 73888b805..6f07bd67c 100644 --- a/drivers/crypto/qat/qat_qp.h +++ b/drivers/crypto/qat/qat_qp.h @@ -90,7 +90,7 @@ struct qat_qp { /**< qat device this qp is on */ } __rte_cache_aligned; -extern const struct qat_qp_hw_data qat_gen1_qps[][ADF_MAX_QPS_PER_BUNDLE]; +extern const struct qat_qp_hw_data qat_gen1_qps[][ADF_MAX_QPS_ON_ANY_SERVICE]; uint16_t qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops); -- 2.13.6