From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 10FC81C49E for ; Fri, 11 May 2018 13:16:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2018 04:16:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,388,1520924400"; d="scan'208";a="40443996" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga008.jf.intel.com with ESMTP; 11 May 2018 04:16:05 -0700 From: Fiona Trahe To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com, tomaszx.jozwiak@intel.com Date: Fri, 11 May 2018 12:14:06 +0100 Message-Id: <1526037249-25545-29-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 v2 28/31] crypto/qat: add MAX PCI DEVICES flag to config file 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, 11 May 2018 11:16:07 -0000 Added CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES to build config files. Signed-off-by: Tomasz Jozwiak --- config/common_base | 5 ++++- config/rte_config.h | 2 ++ drivers/crypto/qat/qat_device.c | 8 ++++---- drivers/crypto/qat/qat_device.h | 2 -- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/config/common_base b/config/common_base index 28557ed66..3dbe95bd4 100644 --- a/config/common_base +++ b/config/common_base @@ -491,7 +491,10 @@ CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_DRIVER=n # on a single QuickAssist device. # CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS=2048 - +# +# Max. number of QuickAssist devices, which can be detected and attached +# +CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES=48 # # Compile PMD for virtio crypto devices # diff --git a/config/rte_config.h b/config/rte_config.h index a1d01759e..e353d8d6d 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -91,6 +91,8 @@ */ /* QuickAssist device */ #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048 +/* Max. number of QuickAssist devices which can be attached */ +#define RTE_PMD_QAT_MAX_PCI_DEVICES 48 /* virtio crypto defines */ #define RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS 1024 diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c index a0e414905..0cab2e928 100644 --- a/drivers/crypto/qat/qat_device.c +++ b/drivers/crypto/qat/qat_device.c @@ -23,7 +23,7 @@ struct qat_gen_hw_data qat_gen_config[] = { }; -static struct qat_pci_device qat_pci_devices[QAT_MAX_PCI_DEVICES]; +static struct qat_pci_device qat_pci_devices[RTE_PMD_QAT_MAX_PCI_DEVICES]; static int qat_nb_pci_devices; /* @@ -62,7 +62,7 @@ qat_pci_get_named_dev(const char *name) if (name == NULL) return NULL; - for (i = 0; i < QAT_MAX_PCI_DEVICES; i++) { + for (i = 0; i < RTE_PMD_QAT_MAX_PCI_DEVICES; i++) { dev = &qat_pci_devices[i]; if ((dev->attached == QAT_ATTACHED) && @@ -78,7 +78,7 @@ qat_pci_find_free_device_index(void) { uint8_t dev_id; - for (dev_id = 0; dev_id < QAT_MAX_PCI_DEVICES; dev_id++) { + for (dev_id = 0; dev_id < RTE_PMD_QAT_MAX_PCI_DEVICES; dev_id++) { if (qat_pci_devices[dev_id].attached == QAT_DETACHED) break; } @@ -111,7 +111,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) } qat_dev_id = qat_pci_find_free_device_index(); - if (qat_dev_id == QAT_MAX_PCI_DEVICES) { + if (qat_dev_id == RTE_PMD_QAT_MAX_PCI_DEVICES) { PMD_DRV_LOG(ERR, "Reached maximum number of QAT devices"); return NULL; } diff --git a/drivers/crypto/qat/qat_device.h b/drivers/crypto/qat/qat_device.h index 3df6520c3..e18c8a706 100644 --- a/drivers/crypto/qat/qat_device.h +++ b/drivers/crypto/qat/qat_device.h @@ -11,11 +11,9 @@ #include "adf_transport_access_macros.h" #include "qat_qp.h" - #define QAT_DETACHED (0) #define QAT_ATTACHED (1) -#define QAT_MAX_PCI_DEVICES 48 #define QAT_DEV_NAME_MAX_LEN 64 /* -- 2.13.6