drivers/qat: fix lacking memzone lookup in compression pmd
diff mbox series

Message ID 20200708094401.16564-1-arkadiuszx.kusztal@intel.com
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series
  • drivers/qat: fix lacking memzone lookup in compression pmd
Related show

Checks

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

Commit Message

Arek Kusztal July 8, 2020, 9:44 a.m. UTC
Because capability memzone of compression does not have lookup
call, second and subsequent devices cannot be created.

Fixes: 0e6fff16a7a2 ("drivers: add multi process handling of capabilities in QAT")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/compress/qat/qat_comp_pmd.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Dybkowski, AdamX July 13, 2020, 12:31 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Arek Kusztal
> Sent: Wednesday, 8 July, 2020 11:44
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [dpdk-dev] [PATCH] drivers/qat: fix lacking memzone lookup in
> compression pmd
> 
> Because capability memzone of compression does not have lookup call,
> second and subsequent devices cannot be created.
> 
> Fixes: 0e6fff16a7a2 ("drivers: add multi process handling of capabilities in
> QAT")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>

Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Jiang, YuX July 15, 2020, 1:53 a.m. UTC | #2
Tested-by:  Jiang, YuX <yux.jiang@intel.com> 

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Dybkowski, AdamX
Sent: Monday, July 13, 2020 8:31 PM
To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
Cc: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Subject: Re: [dpdk-dev] [PATCH] drivers/qat: fix lacking memzone lookup in compression pmd

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Arek Kusztal
> Sent: Wednesday, 8 July, 2020 11:44
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; 
> Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [dpdk-dev] [PATCH] drivers/qat: fix lacking memzone lookup in 
> compression pmd
> 
> Because capability memzone of compression does not have lookup call, 
> second and subsequent devices cannot be created.
> 
> Fixes: 0e6fff16a7a2 ("drivers: add multi process handling of 
> capabilities in
> QAT")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>

Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Akhil Goyal July 15, 2020, 7:48 p.m. UTC | #3
> Tested-by:  Jiang, YuX <yux.jiang@intel.com>
> 
> > Because capability memzone of compression does not have lookup call,
> > second and subsequent devices cannot be created.
> >
> > Fixes: 0e6fff16a7a2 ("drivers: add multi process handling of
> > capabilities in
> > QAT")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> 
> Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Applied to dpdk-next-crypto

Thanks.

Patch
diff mbox series

diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index ecf972a..034abad 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -726,9 +726,12 @@  qat_comp_dev_create(struct qat_pci_device *qat_pci_dev,
 		break;
 	}
 
-	comp_dev->capa_mz = rte_memzone_reserve(capa_memz_name,
-		capa_size,
-		rte_socket_id(), 0);
+	comp_dev->capa_mz = rte_memzone_lookup(capa_memz_name);
+	if (comp_dev->capa_mz == NULL) {
+		comp_dev->capa_mz = rte_memzone_reserve(capa_memz_name,
+			capa_size,
+			rte_socket_id(), 0);
+	}
 	if (comp_dev->capa_mz == NULL) {
 		QAT_LOG(DEBUG,
 			"Error allocating memzone for capabilities, destroying PMD for %s",