[v2] drivers/qat: fix failure to create PMD

Message ID 1538428285-14899-1-git-send-email-fiona.trahe@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series [v2] drivers/qat: fix failure to create PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Fiona Trahe Oct. 1, 2018, 9:11 p.m. UTC
  If QAT crypto pmd failed to be created due to reaching MAX
cryptodevs it prevented QAT comp PMD being created. And vice versa.
Change to warning in these cases and allow the other PMD to be created.
Clarify in documentation.

Fixes: c0c90bc4cade ("compress/qat: add create and destroy functions")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
v2 changes:
 - clarified documentation


 doc/guides/cryptodevs/qat.rst       | 6 +++---
 drivers/compress/qat/qat_comp_pmd.c | 6 ++++--
 drivers/crypto/qat/qat_sym_pmd.c    | 6 ++++--
 3 files changed, 11 insertions(+), 7 deletions(-)
  

Patch

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index b09624f..5793e36 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -166,9 +166,9 @@  options and is built by default.
 The number of VFs per PF varies - see table below. If multiple QAT packages are
 installed on a platform then CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES should be
 adjusted to the number of VFs which the QAT common code will need to handle.
-Note, there is a separate config item for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS,
-if necessary this should be adjusted to handle the total of QAT and other devices
-which the process will use.
+Note, there are separate config items for max cryptodevs CONFIG_RTE_CRYPTO_MAX_DEVS
+and max compressdevs CONFIG_RTE_COMPRESS_MAX_DEVS, if necessary these should
+be adjusted to handle the total of QAT and other devices which the process will use.
 
 QAT allocates internal structures to handle SGLs. For the compression service
 CONFIG_RTE_PMD_QAT_COMP_SGL_MAX_SEGMENTS can be changed if more segments are needed.
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index e34c07b..1b29540 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -389,8 +389,10 @@  qat_comp_dev_create(struct qat_pci_device *qat_pci_dev)
 			sizeof(struct qat_comp_dev_private),
 			&init_params);
 
-	if (compressdev == NULL)
-		return -ENODEV;
+	if (compressdev == NULL) {
+		QAT_LOG(WARNING, "Failed to create QAT COMP device %s", name);
+		return 0;
+	}
 
 	compressdev->dev_ops = &compress_qat_ops;
 
diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c
index 96f442e..fb93030 100644
--- a/drivers/crypto/qat/qat_sym_pmd.c
+++ b/drivers/crypto/qat/qat_sym_pmd.c
@@ -261,8 +261,10 @@  qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
 	cryptodev = rte_cryptodev_pmd_create(name,
 			&(qat_pci_dev->sym_rte_dev), &init_params);
 
-	if (cryptodev == NULL)
-		return -ENODEV;
+	if (cryptodev == NULL) {
+		QAT_LOG(WARNING, "Failed to create QAT SYM device %s", name);
+		return 0;
+	}
 
 	qat_pci_dev->sym_rte_dev.name = cryptodev->data->name;
 	cryptodev->driver_id = cryptodev_qat_driver_id;