From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reshma Pattan Subject: [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d Date: Tue, 24 Jul 2018 15:17:27 +0100 Message-ID: <1532441847-7492-1-git-send-email-reshma.pattan@intel.com> References: <20180723104425.10090-1-jasvinder.singh@intel.com> Cc: bernard.iremonger@intel.com, thomas@monjalon.net, Jasvinder Singh , Reshma Pattan To: dev@dpdk.org 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) In-Reply-To: <20180723104425.10090-1-jasvinder.singh@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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