From patchwork Fri Apr 8 14:15:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 109533 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 69743A050B; Fri, 8 Apr 2022 16:15:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 311F94285C; Fri, 8 Apr 2022 16:15:05 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 90592427ED for ; Fri, 8 Apr 2022 16:15:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649427302; x=1680963302; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PHnc3GbCRUH745Q35nDfCg8gw2GUuNVurY7Aymebtrk=; b=noEWmYji+5yrndBhkdn32fGJIWtd/2tGk2LSpEMMj5Xpw+bUPKJCLu5g 54GWogbqO8umpTBHiqaztohAOWPxLEu93dlwT9F7DLPZ9lRsAJ1r+YrZc sqf8IsBnaalvpdz9nUWcFvpQizNj3P5n65lPPKoOvi9gTjOns0eNr+0qF TQWyBhRtKt+cJp4KF+J1mISG8msMZugyE+083aY9/LwKzE3lgRFvwZQhT BknAwS1PDNdGO1soMEOQMBfUw4WICQdVUT8BmKXiGj2vop3y4cIJRFFu4 3iVC9QJh2D3qAV+RyAiJa8XEoT4TL+wgkjUtjt+JpYdylmz1uWokDwkpo Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="324762479" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="324762479" 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:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="852083835" Received: from silpixa00401122.ir.intel.com ([10.55.128.10]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2022 07:15:00 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: Kevin Laatz , Xiaoyun Li , Aman Singh , Yuying Zhang Subject: [PATCH 4/5] app/testpmd: stop and close dmadevs at exit Date: Fri, 8 Apr 2022 15:15:03 +0100 Message-Id: <20220408141504.1319913-5-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 DMA devices are created during PCI probe in EAL init. In order to perform cleanup for those devices, they need to be stopped and closed. This patch adds the necessary cleanup to ensure clean exit. Signed-off-by: Kevin Laatz --- app/test-pmd/testpmd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index fe2ce19f99..438749c5b8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #ifdef RTE_NET_IXGBE @@ -3402,6 +3403,14 @@ pmd_test_exit(void) } } + /* stop and close all dmadevs */ + RTE_DMA_FOREACH_DEV(i) { + printf("\nStopping and closing dmadev %d...\n", i); + fflush(stdout); + rte_dma_stop(i); + rte_dma_close(i); + } + if (hot_plug) { ret = rte_dev_event_monitor_stop(); if (ret) {