drivers: fix return of unsupported features on QAT GEN4
authorArek Kusztal <arkadiuszx.kusztal@intel.com>
Wed, 28 Jul 2021 16:18:30 +0000 (17:18 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 30 Jul 2021 19:08:19 +0000 (21:08 +0200)
Fix return code when asymmetric crypto
or compression service is selected on GEN4 devices.

Fixes: 8f393c4ffdc1 ("common/qat: support GEN4 devices")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
drivers/compress/qat/qat_comp_pmd.c
drivers/crypto/qat/qat_asym_pmd.c

index cfdcb6b..caac783 100644 (file)
@@ -713,7 +713,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev,
 
        if (qat_pci_dev->qat_dev_gen == QAT_GEN4) {
                QAT_LOG(ERR, "Compression PMD not supported on QAT 4xxx");
-               return 0;
+               return -EFAULT;
        }
        snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "comp");
index 56ccca3..d844dd8 100644 (file)
@@ -253,7 +253,7 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev,
 
        if (qat_pci_dev->qat_dev_gen == QAT_GEN4) {
                QAT_LOG(ERR, "Asymmetric crypto PMD not supported on QAT 4xxx");
-               return 0;
+               return -EFAULT;
        }
        snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s",
                        qat_pci_dev->name, "asym");