From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A0A7DA050B;
	Fri,  8 Apr 2022 16:15:19 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 5143842858;
	Fri,  8 Apr 2022 16:15:04 +0200 (CEST)
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by mails.dpdk.org (Postfix) with ESMTP id DD9F2410EC
 for <dev@dpdk.org>; Fri,  8 Apr 2022 16:15:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1649427301; x=1680963301;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=ODbjNIwS560D8/uBxgIDJwDE/Deh40bk7iPxnNWARJA=;
 b=ZKdm9xJMEkmS/d8DN4QC+uWaUqAgcFCMGHS9RIWJ+DWALGNs6zo+bem/
 c/Z+08bkXe1IiNZtUPjJmooKCzfolgI+O4o4y6cz/qfYLMH+uLbowDjwz
 61PJitvJNH4gxMI7C9Vr2yDPfIQZnQrWTqTOpyPwe4c+pyRbOXNW4koTW
 cAbwd4fbgn5URPjcH3OsJWEzKKFATHspDGMboxMmgg8QWWlZIzXYxG28Y
 OWIDHhifu6Qx/xxWDcP7ExU8gwknu1QSbx23ujLT4t/Tf4hqWbykNoEOh
 X0X1i49rDKeoI0x1dhXaErhF9AYJkm/HHZJAdwmsmrZsADxTtZAJ9UKZ3 Q==;
X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="324762475"
X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="324762475"
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:00 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="852083828"
Received: from silpixa00401122.ir.intel.com ([10.55.128.10])
 by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2022 07:14:59 -0700
From: Kevin Laatz <kevin.laatz@intel.com>
To: dev@dpdk.org
Cc: Kevin Laatz <kevin.laatz@intel.com>
Subject: [PATCH 3/5] app/test: close dma devices during cleanup
Date: Fri,  8 Apr 2022 15:15:02 +0100
Message-Id: <20220408141504.1319913-4-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
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

DMA devices are created during PCI probe of EAL init. These devices
need to be closed in order to perform necessary cleanup for those
devices. This patch adds the call to close() for all DMA devices.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
 app/test/test.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test/test.c b/app/test/test.c
index e69cae3eea..cc986e5cc9 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -24,6 +24,7 @@ extern cmdline_parse_ctx_t main_ctx[];
 #include <rte_cycles.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
+#include <rte_dmadev.h>
 #ifdef RTE_LIB_TIMER
 #include <rte_timer.h>
 #endif
@@ -244,6 +245,11 @@ main(int argc, char **argv)
 #ifdef RTE_LIB_TIMER
 	rte_timer_subsystem_finalize();
 #endif
+
+	/* close all dmadevs */
+	RTE_DMA_FOREACH_DEV(i)
+		rte_dma_close(i);
+
 	rte_eal_cleanup();
 	return ret;
 }
-- 
2.31.1