DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/qat: fix failure to create PMD
@ 2018-10-01 15:36 Fiona Trahe
  2018-10-01 21:11 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
  0 siblings, 1 reply; 5+ messages in thread
From: Fiona Trahe @ 2018-10-01 15:36 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, stable, tomaszx.jozwiak, Fiona Trahe

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(-)

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;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] drivers/qat: fix failure to create PMD
  2018-10-01 15:36 [dpdk-dev] [PATCH] drivers/qat: fix failure to create PMD Fiona Trahe
@ 2018-10-01 21:11 ` Fiona Trahe
  2018-10-11 17:14   ` [dpdk-dev] [PATCH v3] " Fiona Trahe
  0 siblings, 1 reply; 5+ messages in thread
From: Fiona Trahe @ 2018-10-01 21:11 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, stable, tomaszx.jozwiak, Fiona Trahe

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(-)

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;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v3] drivers/qat: fix failure to create PMD
  2018-10-01 21:11 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
@ 2018-10-11 17:14   ` Fiona Trahe
  2018-10-11 17:27     ` Cel, TomaszX
  0 siblings, 1 reply; 5+ messages in thread
From: Fiona Trahe @ 2018-10-11 17:14 UTC (permalink / raw)
  To: dev; +Cc: akhil.goyal, stable, tomaszx.jozwiak, tomaszx.cel, Fiona Trahe

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.

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

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
v3 changes:
 - moved checks up a layer to the probe fn as more appropriate place.

v2 changes:
 - clarified documentation

 drivers/common/qat/qat_device.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index b158fb9..6e64e22 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -196,6 +196,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		struct rte_pci_device *pci_dev)
 {
 	int ret = 0;
+	int num_pmds_created = 0;
 	struct qat_pci_device *qat_pci_dev;
 
 	QAT_LOG(DEBUG, "Found QAT device at %02x:%02x.%x",
@@ -208,23 +209,33 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		return -ENODEV;
 
 	ret = qat_sym_dev_create(qat_pci_dev);
-	if (ret != 0)
-		goto error_out;
+	if (ret == 0)
+		num_pmds_created++;
+	else
+		QAT_LOG(WARNING,
+				"Failed to create QAT SYM PMD on device %s",
+				qat_pci_dev->name);
 
 	ret = qat_comp_dev_create(qat_pci_dev);
-	if (ret != 0)
-		goto error_out;
+	if (ret == 0)
+		num_pmds_created++;
+	else
+		QAT_LOG(WARNING,
+				"Failed to create QAT COMP PMD on device %s",
+				qat_pci_dev->name);
 
 	ret = qat_asym_dev_create(qat_pci_dev);
-	if (ret != 0)
-		goto error_out;
+	if (ret == 0)
+		num_pmds_created++;
+	else
+		QAT_LOG(WARNING,
+				"Failed to create QAT ASYM PMD on device %s",
+				qat_pci_dev->name);
 
-	return 0;
-
-error_out:
-	qat_pci_dev_destroy(qat_pci_dev, pci_dev);
-	return ret;
+	if (num_pmds_created == 0)
+		qat_pci_dev_destroy(qat_pci_dev, pci_dev);
 
+	return 0;
 }
 
 static int qat_pci_remove(struct rte_pci_device *pci_dev)
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v3] drivers/qat: fix failure to create PMD
  2018-10-11 17:14   ` [dpdk-dev] [PATCH v3] " Fiona Trahe
@ 2018-10-11 17:27     ` Cel, TomaszX
  2018-10-16 14:37       ` Akhil Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: Cel, TomaszX @ 2018-10-11 17:27 UTC (permalink / raw)
  To: Trahe, Fiona, dev; +Cc: akhil.goyal, stable, Jozwiak, TomaszX

> -----Original Message-----
> From: Trahe, Fiona
> Sent: Thursday, October 11, 2018 7:14 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; stable@dpdk.org; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; Cel, TomaszX <tomaszx.cel@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>
> Subject: [PATCH v3] drivers/qat: fix failure to create PMD
> 
> 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.
> 
> Fixes: c0c90bc4cade ("compress/qat: add create and destroy functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> ---
> v3 changes:
>  - moved checks up a layer to the probe fn as more appropriate place.
> 
> v2 changes:
>  - clarified documentation
> 
>  drivers/common/qat/qat_device.c | 33 ++++++++++++++++++++++---------
> --
>  1 file changed, 22 insertions(+), 11 deletions(-)

Acked-by: Tomasz Cel <tomaszx.cel@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v3] drivers/qat: fix failure to create PMD
  2018-10-11 17:27     ` Cel, TomaszX
@ 2018-10-16 14:37       ` Akhil Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2018-10-16 14:37 UTC (permalink / raw)
  To: Cel, TomaszX, Trahe, Fiona, dev; +Cc: stable, Jozwiak, TomaszX



On 10/11/2018 10:57 PM, Cel, TomaszX wrote:
>> -----Original Message-----
>> From: Trahe, Fiona
>> Sent: Thursday, October 11, 2018 7:14 PM
>> To: dev@dpdk.org
>> Cc: akhil.goyal@nxp.com; stable@dpdk.org; Jozwiak, TomaszX
>> <tomaszx.jozwiak@intel.com>; Cel, TomaszX <tomaszx.cel@intel.com>;
>> Trahe, Fiona <fiona.trahe@intel.com>
>> Subject: [PATCH v3] drivers/qat: fix failure to create PMD
>>
>> 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.
>>
>> Fixes: c0c90bc4cade ("compress/qat: add create and destroy functions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
>> ---
>> v3 changes:
>>   - moved checks up a layer to the probe fn as more appropriate place.
>>
>> v2 changes:
>>   - clarified documentation
>>
>>   drivers/common/qat/qat_device.c | 33 ++++++++++++++++++++++---------
>> --
>>   1 file changed, 22 insertions(+), 11 deletions(-)
> Acked-by: Tomasz Cel <tomaszx.cel@intel.com>
Applied to dpdk-next-crypto

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-16 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 15:36 [dpdk-dev] [PATCH] drivers/qat: fix failure to create PMD Fiona Trahe
2018-10-01 21:11 ` [dpdk-dev] [PATCH v2] " Fiona Trahe
2018-10-11 17:14   ` [dpdk-dev] [PATCH v3] " Fiona Trahe
2018-10-11 17:27     ` Cel, TomaszX
2018-10-16 14:37       ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).