From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cristian Dumitrescu Subject: [PATCH] app/test-pmd: stop all ports before any close Date: Thu, 3 Jan 2019 16:37:05 +0000 Message-ID: <20190103163705.45497-1-cristian.dumitrescu@intel.com> Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com To: dev@dpdk.org Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id B10F51B3A5 for ; Thu, 3 Jan 2019 17:37:07 +0100 (CET) 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 stoping 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. Signed-off-by: Cristian Dumitrescu --- 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); /* -- 2.17.1