From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CCFFF2B8D for ; Thu, 6 Oct 2016 19:45:48 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 06 Oct 2016 10:45:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,454,1473145200"; d="scan'208";a="887426259" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 06 Oct 2016 10:45:47 -0700 Received: from linux.site (sisvmlab045.ir.intel.com [10.237.216.52]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u96HjjE0026584; Thu, 6 Oct 2016 18:45:45 +0100 Received: by linux.site (Postfix, from userid 11342333) id 0F7EBE3BC2; Thu, 6 Oct 2016 18:34:50 +0100 (IST) From: Fiona Trahe To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com, akhil.goyal@nxp.com Date: Thu, 6 Oct 2016 18:34:26 +0100 Message-Id: <1475775269-21454-2-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <20160926163300.22990-1-akhil.goyal@nxp.com> References: <20160926163300.22990-1-akhil.goyal@nxp.com> Subject: [dpdk-dev] [PATCH v3 1/4] crypto/aesni_mb: free ring memory on qp release in PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 17:45:49 -0000 Free ring memory on queue_pair release, else releasing and setting up queue-pair of a different size fails. Signed-off-by: Fiona Trahe --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c index d3c46ac..3d49e2a 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c @@ -311,8 +311,14 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev, static int aesni_mb_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { - if (dev->data->queue_pairs[qp_id] != NULL) { - rte_free(dev->data->queue_pairs[qp_id]); + struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id]; + struct rte_ring *r = NULL; + + if (qp != NULL) { + r = rte_ring_lookup(qp->name); + if (r) + rte_ring_free(r); + rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; } return 0; -- 2.5.0