From patchwork Fri Jan 4 12:28:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Dumitrescu X-Patchwork-Id: 49446 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 602F01B49C; Fri, 4 Jan 2019 13:28:37 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 434C61B497; Fri, 4 Jan 2019 13:28:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2019 04:28:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,438,1539673200"; d="scan'208";a="123247796" Received: from silpixa00382658.ir.intel.com (HELO silpixa00382658.ger.corp.intel.com) ([10.237.223.75]) by orsmga002.jf.intel.com with ESMTP; 04 Jan 2019 04:28:33 -0800 From: Cristian Dumitrescu To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, stable@dpdk.org Date: Fri, 4 Jan 2019 12:28:33 +0000 Message-Id: <20190104122833.49245-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix quit to stop all ports before close 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" This patch proposes a slightly different test-pmd quit operation: stop all devices before starting to close any device. Basically, stop all moving parts before beginning to remove them. The current test-pmd quit is stopping and closing each device before moving to the next device. If all devices in the system are independent of each other, this difference is usually not important. In case of Soft NIC devices, any such virtual device typically depends on one or more physical devices being alive, as it accesses their queues, so this difference becomes important. Without this straightforward fix, all the Soft NIC devices need to be manually stopped before the quit command is issued, otherwise the quit command can sometimes crash the test-pmd application. Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM") Cc: stable@dpdk.org Signed-off-by: Cristian Dumitrescu Acked-by: Bernard Iremonger --- Changes in V2: -reworded title -added Fixes and Cc lines app/test-pmd/testpmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8d584b008..15a948828 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2391,9 +2391,13 @@ pmd_test_exit(void) if (ports != NULL) { no_link_check = 1; RTE_ETH_FOREACH_DEV(pt_id) { - printf("\nShutting down port %d...\n", pt_id); + printf("\nStopping port %d...\n", pt_id); fflush(stdout); stop_port(pt_id); + } + RTE_ETH_FOREACH_DEV(pt_id) { + printf("\nShutting down port %d...\n", pt_id); + fflush(stdout); close_port(pt_id); /*