crypto/qat: add max PCI devices to config file
authorFiona Trahe <fiona.trahe@intel.com>
Wed, 13 Jun 2018 12:14:16 +0000 (14:14 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 27 Jun 2018 23:25:33 +0000 (01:25 +0200)
Added CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES to
build config files.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
config/common_base
config/rte_config.h
drivers/crypto/qat/qat_device.c
drivers/crypto/qat/qat_device.h

index fcf3a1f..c290b1c 100644 (file)
@@ -495,6 +495,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
index a1d0175..e353d8d 100644 (file)
@@ -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
index a0e4149..0cab2e9 100644 (file)
@@ -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;
        }
index 3df6520..e18c8a7 100644 (file)
 #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
 
 /*