[dpdk-dev] [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d

Reshma Pattan reshma.pattan at intel.com
Tue Jul 24 16:17:27 CEST 2018


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 <motih at mellanox.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
---
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



More information about the dev mailing list