From patchwork Fri Apr 8 14:15:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 109534 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92682A050B; Fri, 8 Apr 2022 16:15:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 208E842864; Fri, 8 Apr 2022 16:15:06 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B9FBF42800; Fri, 8 Apr 2022 16:15:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649427304; x=1680963304; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oIRrUefB/hIBj+IVHApcl59CJd8D6+zjE+ettjyiymg=; b=GMPkpAd5d6RcNhasvgvIEeCHGB9zkBSgsvlTsnWGEFLqeSPAHyqpIFHP HdtF5uwoemriK0Lr1q+S4UipS0TlCocXgs//3foNZgegQwxSQ05xCAaRO Do8RhR73NqqLHzn9DwMIqMZ7pTWGCavlaHjCsCDU7V/6h65R/0KgiQvlN fIf2epCCFzJDYUysuFD8fQsrgnE55jiT3t4o97yeoihx4r5FMfgPYLtby juBzrem6ZB8ezwUVbeqCYKVUZc29UPtDWWuT+jzlHMMn5f3tT7myRM4we 1FzMwGH83nfAC+xq+2kB0JDMgPXdElAXLF9+F7zM+AH6a713sTaUzS0aQ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="324762490" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="324762490" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 07:15:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="852083853" Received: from silpixa00401122.ir.intel.com ([10.55.128.10]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2022 07:15:01 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: Kevin Laatz , stable@dpdk.org, bruce.richardson@intel.com, Chengwen Feng , Conor Walsh Subject: [PATCH 5/5] examples/dma: fix missing dma close Date: Fri, 8 Apr 2022 15:15:04 +0100 Message-Id: <20220408141504.1319913-6-kevin.laatz@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220408141504.1319913-1-kevin.laatz@intel.com> References: <20220408141504.1319913-1-kevin.laatz@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The application stops all dmadevs that it used but never closed any, meaning device cleanup was not done. This patch adds device cleanup for all dmadevs. All devices need to be closed for completeness, since devices not used by the application may also have been created during PCI probe of EAL init. Fixes: d047310407a3 ("examples/ioat: port application to dmadev API") Cc: stable@dpdk.org Cc: bruce.richardson@intel.com Signed-off-by: Kevin Laatz --- examples/dma/dmafwd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c index 608487e35c..4c612a0e0b 100644 --- a/examples/dma/dmafwd.c +++ b/examples/dma/dmafwd.c @@ -1097,6 +1097,12 @@ main(int argc, char **argv) rte_ring_free(cfg.ports[i].rx_to_tx_ring); } + /* close all dmadevs */ + RTE_DMA_FOREACH_DEV(i) { + printf("Closing dmadev %d\n", i); + rte_dma_close(i); + } + /* clean up the EAL */ rte_eal_cleanup();