From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B0D19235 for ; Tue, 24 Jul 2018 16:17:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 07:17:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,398,1526367600"; d="scan'208";a="74067240" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Jul 2018 07:17:29 -0700 From: Reshma Pattan To: dev@dpdk.org Cc: bernard.iremonger@intel.com, thomas@monjalon.net, Jasvinder Singh , Reshma Pattan Date: Tue, 24 Jul 2018 15:17:27 +0100 Message-Id: <1532441847-7492-1-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <20180723104425.10090-1-jasvinder.singh@intel.com> References: <20180723104425.10090-1-jasvinder.singh@intel.com> Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d 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: , X-List-Received-Date: Tue, 24 Jul 2018 14:17:33 -0000 Testpmd should be existed gracefully when ctrl+d is typed. This behaviour is not handled properly, fix this by calling pmd_test_exit() instead of rte_panic. Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode") Reported-by: Mordechay Haimovsky Signed-off-by: Jasvinder Singh Signed-off-by: Reshma Pattan --- v2: removed changes done to lib/librte_cmdline/cmdline.c reworded commit message and heading. --- app/test-pmd/cmdline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 588528928..406008d73 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -17581,9 +17581,9 @@ prompt(void) for (;;) { status = cmdline_poll(testpmd_cl); - if (status < 0) - rte_panic("CLI poll error (%" PRId32 ")\n", status); - else if (status == RDLINE_EXITED) { + if (status == RDLINE_EXITED || status == -1) { + if (status == -1) + pmd_test_exit(); cmdline_stdin_exit(testpmd_cl); rte_exit(0, "\n"); } -- 2.14.4