From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D01E241E93; Tue, 14 Mar 2023 18:37:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E27C442C24; Tue, 14 Mar 2023 18:36:56 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id E2D8942BAC for ; Tue, 14 Mar 2023 18:36:54 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id iw3so547870plb.6 for ; Tue, 14 Mar 2023 10:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678815414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dKtXYqVpwQcY6GrO3PXl9oT9wgiSfDwbFAHbjsnSxhI=; b=09ntMPGwg8XZKqVhKSrgnyS3hXj7Oxz+xAbt+oGmmz4An3J70exwpVgHdpfs1PTi1n HBeXiWumtMjSUW8+YRAUDL1Q4QgclT8FNhrI1pQHY+UqvjSYL4STFoYciNDNlXyaYaxO HPPz7nOOTeRGT9/hVh8nJBPCY5wBctKsahUfD4U8OpmiQDh3ABU9Q1UEndtJYX8lpyVT jON2cqvrS2X9dFCyO9QtK3OfzWtgicS/3K31JvTRgtS0wMDSYMLE4tHNf7EuktgkvZ8x GgKpiUQp0qmPX7CLL6qVArhF2AvtCcvlFYKi5hKnB8Uv7HIxpjc49adAPcLfp6D4xzLc ZVrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678815414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dKtXYqVpwQcY6GrO3PXl9oT9wgiSfDwbFAHbjsnSxhI=; b=Y66oBCdvagbHloXsuoLqDJ27d8BaGf+/WuOMxC7e8FsTu8E+b7w1maFiK70j7wjnfx A1PkJnCrv+agYY16WdpQGyC9hvM/eNtw1aioIjgYsHFdCYmqB+UOLfEdlh7Sf4yIsEte whwKuG/bJ9USoujaoK7td53DYIH8mFFuLChcNd0Pg9pQsE8u3272Za4GbnhXdf4kHhA8 p4EOJ6og1MjMk6qhqFKipM9Yd1X2MpvCWGrim7OL6+4Jgo4GwD1iUrvTS078sePpEZtL kcoNGIgVPFn/JH1hRXVIeWODh9pV2rspE/dCavPgUi9fpzmNMzMKr/WiTgdcQbQjChcn EbIw== X-Gm-Message-State: AO0yUKWFeM1cFxhPZq6kBERMrQFQiyW+pz6Il4NDMHpQFSw975T9HXnu OYkVhUnPgQBpHvKBk4bU/0CZUWTpBz/loabvw42Ibg== X-Google-Smtp-Source: AK7set8U+/h5+IIJIaIxGc8wO5yHfkWWPLMK6V171JrLPTGGQcHKYqVXLbZ2/5z6UEiiZrA6wt7LMw== X-Received: by 2002:a17:903:283:b0:19e:72cb:ff83 with SMTP id j3-20020a170903028300b0019e72cbff83mr47890337plr.8.1678815413861; Tue, 14 Mar 2023 10:36:53 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q11-20020a170902a3cb00b0019ac9c4f32esm1979970plb.309.2023.03.14.10.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 10:36:53 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v3 3/3] testpmd: enable interrupt in interactive mode Date: Tue, 14 Mar 2023 10:36:48 -0700 Message-Id: <20230314173648.69528-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314173648.69528-1-stephen@networkplumber.org> References: <20230313171905.67720-1-stephen@networkplumber.org> <20230314173648.69528-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The setting in terminal handling for both Unix style and Windows was not ensuring that Ctrl-C character would cause interrupt. This is a first release bug. Testpmd interactive mode has always disabled control-c handling on Linux. Fixes: af75078fece3 ("first public release") Signed-off-by: Stephen Hemminger --- 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 5f9839a15f98..356c5b3f3ca2 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 80863bfc8a00..8cff3b175747 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