From patchwork Wed Jul 8 09:44:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 73522 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB333A00BE; Wed, 8 Jul 2020 11:46:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C13161DA9A; Wed, 8 Jul 2020 11:46:32 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id E85F51D502 for ; Wed, 8 Jul 2020 11:46:30 +0200 (CEST) IronPort-SDR: 9+C9YLLG8JALkuPgzUKt2i/g/dn2w5UH1jM3soe8w2e9IVEZdiZVJK5ES+P6twq7wuZsIkcgqp +pCnZo/iGj7Q== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="127847269" X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="127847269" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 02:46:30 -0700 IronPort-SDR: 8dd9uWF+Yagbdwl7+Y/M2YoD9szzftBk9gvAAZ4danNLhoGTASpyYJ7AfBRDBfAN+wbm7c8rJp ech2SoDbMuaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="315817961" Received: from akusztax-mobl.ger.corp.intel.com ([10.104.125.99]) by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2020 02:46:28 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, fiona.trahe@intel.com, Arek Kusztal Date: Wed, 8 Jul 2020 11:44:01 +0200 Message-Id: <20200708094401.16564-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] drivers/qat: fix lacking memzone lookup in compression pmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Adam Dybkowski Tested-by: Jiang, YuX Acked-by: Adam Dybkowski --- drivers/compress/qat/qat_comp_pmd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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",