drivers/qat: fix failure to create PMD

Message ID 1538408212-31349-1-git-send-email-fiona.trahe@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series 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, 3:36 p.m. UTC
  If QAT crypto pmd failed to be created due to reaching max allowed
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.

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

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/compress/qat/qat_comp_pmd.c | 6 ++++--
 drivers/crypto/qat/qat_sym_pmd.c    | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 63af23a..6510cca 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 c3f7004..82fde16 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;