DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix testpmd exit using ctrl+d
@ 2018-07-23 10:44 Jasvinder Singh
  2018-07-24  9:25 ` Iremonger, Bernard
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Jasvinder Singh @ 2018-07-23 10:44 UTC (permalink / raw)
  To: dev; +Cc: bernard.iremonger, reshma.pattan

Fix testpmd app exit by pressing ctrl+d, End-of-Transmission character (EOT)
on the empty command line.
 
Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode")

Reported-by: Mordechay Haimovsky <motih@mellanox.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 app/test-pmd/cmdline.c       | 10 ++++++----
 lib/librte_cmdline/cmdline.c |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 5885289..edaf0e6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -17581,12 +17581,14 @@ 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 == RDLINE_RES_EOF) {
+			if (status == RDLINE_RES_EOF)
+				pmd_test_exit();
+
 			cmdline_stdin_exit(testpmd_cl);
 			rte_exit(0, "\n");
-		}
+		} else if (status < 0)
+			rte_panic("CLI poll error (%" PRId32 ")\n", status);
 
 #if defined RTE_LIBRTE_PMD_SOFTNIC
 
diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 591b78b..47b0f6a 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -187,7 +187,7 @@ cmdline_in(struct cmdline *cl, const char *buf, int size)
 			rdline_newline(&cl->rdl, cl->prompt);
 		}
 		else if (ret == RDLINE_RES_EOF)
-			return -1;
+			return RDLINE_RES_EOF;
 		else if (ret == RDLINE_RES_EXITED)
 			return -1;
 	}
-- 
2.9.3

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2018-07-26 14:14 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 10:44 [dpdk-dev] [PATCH] app/testpmd: fix testpmd exit using ctrl+d Jasvinder Singh
2018-07-24  9:25 ` Iremonger, Bernard
2018-07-24 11:25 ` Thomas Monjalon
2018-07-24 12:33   ` Thomas Monjalon
2018-07-24 12:39     ` Pattan, Reshma
2018-07-24 12:41     ` Iremonger, Bernard
2018-07-24 13:39       ` Thomas Monjalon
2018-07-24 14:37     ` Mordechay Haimovsky
2018-07-24 16:59       ` Dumitrescu, Cristian
2018-07-25  8:18         ` Thomas Monjalon
2018-07-25  8:30           ` Singh, Jasvinder
2018-07-25  8:49             ` Dumitrescu, Cristian
2018-07-25  8:53             ` Mordechay Haimovsky
2018-07-25  9:04         ` Ananyev, Konstantin
2018-07-25  9:36           ` Dumitrescu, Cristian
2018-07-25 11:39             ` Ananyev, Konstantin
2018-07-25 11:55               ` Mordechay Haimovsky
2018-07-25 11:56               ` Dumitrescu, Cristian
2018-07-25 12:18                 ` Ananyev, Konstantin
2018-07-25 12:27                   ` Van Haaren, Harry
2018-07-25 13:21                     ` Dumitrescu, Cristian
2018-07-25 12:41                   ` Dumitrescu, Cristian
2018-07-25 13:34                     ` Ananyev, Konstantin
2018-07-24 14:17 ` [dpdk-dev] [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d Reshma Pattan
2018-07-24 14:46   ` Pattan, Reshma
2018-07-24 15:31     ` Pattan, Reshma
2018-07-24 15:31     ` Iremonger, Bernard
2018-07-26 14:14     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).