* [Bug 1180] TestPMD shell get stuck
@ 2023-03-12 17:09 bugzilla
2023-03-12 21:39 ` Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: bugzilla @ 2023-03-12 17:09 UTC (permalink / raw)
To: dev
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
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
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 2544 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bug 1180] TestPMD shell get stuck
2023-03-12 17:09 [Bug 1180] TestPMD shell get stuck bugzilla
@ 2023-03-12 21:39 ` Stephen Hemminger
2023-03-12 23:01 ` Stephen Hemminger
2023-03-22 9:36 ` bugzilla
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-03-12 21:39 UTC (permalink / raw)
To: bugzilla; +Cc: dev
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
>
IANAW (I am not a Windows Programmer)
Is there a way to read from stdin and get interrupted if Ctrl C is hit.
On Linux, this requires doing select() then do a read() since the default
behaviour is to restart the read() on signal.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bug 1180] TestPMD shell get stuck
2023-03-12 17:09 [Bug 1180] TestPMD shell get stuck bugzilla
2023-03-12 21:39 ` Stephen Hemminger
@ 2023-03-12 23:01 ` Stephen Hemminger
2023-03-22 9:36 ` bugzilla
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-03-12 23:01 UTC (permalink / raw)
To: bugzilla; +Cc: dev
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug 1180] TestPMD shell get stuck
2023-03-12 17:09 [Bug 1180] TestPMD shell get stuck bugzilla
2023-03-12 21:39 ` Stephen Hemminger
2023-03-12 23:01 ` Stephen Hemminger
@ 2023-03-22 9:36 ` bugzilla
2 siblings, 0 replies; 4+ messages in thread
From: bugzilla @ 2023-03-22 9:36 UTC (permalink / raw)
To: dev
[-- Attachment #1: Type: text/plain, Size: 645 bytes --]
https://bugs.dpdk.org/show_bug.cgi?id=1180
Pier Damouny (pdamouny@nvidia.com) changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Pier Damouny (pdamouny@nvidia.com) ---
the issue was solved by commit
f1d0993e034e39968a2c80a8561b46c260c27487
https://github.com/Mellanox/dpdk.org/commit/f1d0993e034e39968a2c80a8561b46c260c27487
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 2667 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-22 9:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-12 17:09 [Bug 1180] TestPMD shell get stuck bugzilla
2023-03-12 21:39 ` Stephen Hemminger
2023-03-12 23:01 ` Stephen Hemminger
2023-03-22 9:36 ` bugzilla
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).