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 9372D41EA2; Wed, 15 Mar 2023 18:31:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C131142BAC; Wed, 15 Mar 2023 18:31:39 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 253D0410FB for ; Wed, 15 Mar 2023 18:31:38 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id l9-20020a17090a3f0900b0023d32684e7fso3891428pjc.1 for ; Wed, 15 Mar 2023 10:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678901497; 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=Y0D1JkbodMvbDP9WkCP1mRnBBdk8XOJEADOi5581CoW1mYZKQgFeW17i3rphg33Gyw cfd+87V3XWcr+EMG4ApJ8OG3003bl4rPWqi0sQX6k79u5WSdGp0oCs7immNMcRUGS/iU XmagEc0Dtc55VpXVJMtDdWTO2nVVY8QoAbFCQNNkwfJ1aCX21MIc4UQuWbY4RzGHHlpZ 0oV5IWUhwGqhjp4SfdQ+bXfV6BmBE1rEB6Dt0wIYTZ1RjqLA9F+FdMqKDnarvNI45dzm Ct5UAAn4umDuZTZ7ZdGPktSYT4IjZlAjz2eIO2Bw/NB9xSs6KjXgETVbfAWwmxyBV7+C FeEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678901497; 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=Y/2KJX/SpBOtEkLhOvCmVOAqjffMVVwDpLT64Gm6hNdiw6cjs4IDCD0FfqJ5ag7isF M0zYgcxVBE/GrwUUcUsJVgEGknrKV0Ns3DK5TvjzmDqWKtaHqfpAlslq1UgUKLphHynp N3cUNu/pHqZ9RoOiHTCS4SgRBdMk4R00kJONMHoQnEzLOVLqK6YbTDvYYuAHPOG1f7Tv 5ItyQY8Vbon5MpEcV4nxAfpi1bUT+dxKUfQRC5w/UmVgvQ8c9YG/4HsuVMoXVEZx10jr T63PxUcTX/n8vlFGv3NAmX0H4c64aS1KPpDyr/b4bCXqZL0OxI8YoQXTIzDJSyACgWXG lBaQ== X-Gm-Message-State: AO0yUKUTzIZ6JTFaoKIKDI0JtPIsr1yvWncSlYzwktUuaydkJXE9gh3m f8qsZp7JgK48tq6ryFMBDHweIuhXk9QZziN1aMvC9A== X-Google-Smtp-Source: AK7set/1LJC3FwdxyB0FW9/Syvec2Mq1yhEsnlk9fTPnWJVNllrrd+6M/iKeHAUiDV7Jd9sPrSCApQ== X-Received: by 2002:a05:6a21:3391:b0:cc:b1eb:e5f7 with SMTP id yy17-20020a056a21339100b000ccb1ebe5f7mr680126pzb.23.1678901497140; Wed, 15 Mar 2023 10:31:37 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id s5-20020aa78285000000b005d296facfa3sm3803256pfm.36.2023.03.15.10.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 10:31:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v4 2/2] testpmd: enable interrupt in interactive mode Date: Wed, 15 Mar 2023 10:31:32 -0700 Message-Id: <20230315173132.4044-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315173132.4044-1-stephen@networkplumber.org> References: <20230313171905.67720-1-stephen@networkplumber.org> <20230315173132.4044-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