DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: bugzilla@dpdk.org
Cc: dev@dpdk.org
Subject: Re: [Bug 1180] TestPMD shell get stuck
Date: Sun, 12 Mar 2023 16:01:52 -0700	[thread overview]
Message-ID: <20230312160152.118418dc@hermes.local> (raw)
In-Reply-To: <bug-1180-3@http.bugs.dpdk.org/>

On Sun, 12 Mar 2023 17:09:12 +0000
bugzilla@dpdk.org wrote:

> https://bugs.dpdk.org/show_bug.cgi?id=1180
> 
>             Bug ID: 1180
>            Summary: TestPMD shell get stuck
>            Product: DPDK
>            Version: unspecified
>           Hardware: x86
>                 OS: Windows
>             Status: UNCONFIRMED
>           Severity: major
>           Priority: Normal
>          Component: testpmd
>           Assignee: dev@dpdk.org
>           Reporter: pdamouny@nvidia.com
>   Target Milestone: ---
> 
> from the commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff
> 
> when entering testpmd with interactive mode 
> while writing the shell get stuck and cant enter or CTRL C
> 

Try this patch, it works on Linux. Sorry, don't have time or setup to run DPDK on Windows.
I am totally volunteer on the project now.

From f3410ed290c2f2b1981be289a121089366edcb4c Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sun, 12 Mar 2023 15:58:14 -0700
Subject: [PATCH] testpmd: make sure ctrl-c causes SIGINT

The setting in terminal handling for both Unix style and
Windows was not ensuring that Ctrl-C character would
cause interrupt.

Fixes: 0fd1386c30c3 ("app/testpmd: cleanup cleanly from signal")
Bugzilla ID: 1180
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/cmdline/cmdline_os_unix.c    | 3 ++-
 lib/cmdline/cmdline_os_windows.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/cmdline/cmdline_os_unix.c b/lib/cmdline/cmdline_os_unix.c
index 64a945a34fb3..755a6141546d 100644
--- a/lib/cmdline/cmdline_os_unix.c
+++ b/lib/cmdline/cmdline_os_unix.c
@@ -16,7 +16,8 @@ terminal_adjust(struct cmdline *cl)
 	tcgetattr(0, &cl->oldterm);
 
 	memcpy(&term, &cl->oldterm, sizeof(term));
-	term.c_lflag &= ~(ICANON | ECHO | ISIG);
+	term.c_lflag &= ~(ICANON | ECHO);
+	term.c_lflag |= ISIG;
 	tcsetattr(0, TCSANOW, &term);
 
 	setbuf(stdin, NULL);
diff --git a/lib/cmdline/cmdline_os_windows.c b/lib/cmdline/cmdline_os_windows.c
index 73ed9ba290b8..be11409029a2 100644
--- a/lib/cmdline/cmdline_os_windows.c
+++ b/lib/cmdline/cmdline_os_windows.c
@@ -32,10 +32,10 @@ terminal_adjust(struct cmdline *cl)
 		mode &= ~(
 			ENABLE_LINE_INPUT |      /* no line buffering */
 			ENABLE_ECHO_INPUT |      /* no echo */
-			ENABLE_PROCESSED_INPUT | /* pass Ctrl+C to program */
 			ENABLE_MOUSE_INPUT |     /* no mouse events */
 			ENABLE_WINDOW_INPUT);    /* no window resize events */
-		mode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
+		mode |= ENABLE_VIRTUAL_TERMINAL_INPUT |
+			ENABLE_PROCESSED_INPUT; /* Ctrl C processed by the system */
 		SetConsoleMode(handle, mode);
 	}
 
-- 
2.39.2



  parent reply	other threads:[~2023-03-12 23:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 17:09 bugzilla
2023-03-12 21:39 ` Stephen Hemminger
2023-03-12 23:01 ` Stephen Hemminger [this message]
2023-03-22  9:36 ` bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230312160152.118418dc@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).