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 83E81432DA for ; Wed, 8 Nov 2023 20:25:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D79B42D66; Wed, 8 Nov 2023 20:25:59 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 05EF640395 for ; Wed, 8 Nov 2023 20:25:58 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40836ea8cbaso19135e9.0 for ; Wed, 08 Nov 2023 11:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471557; x=1700076357; darn=dpdk.org; 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=snqi9ZAb69U97s+7VMf1BAq4rrxCeqGoe37aqQ1Toc8=; b=GDwlKnr6C1W2Oi+v6Ymh2KxSTX+nlWVCN/lhbEM/VJcSnaQlgmF1Qi+GDkfyXf5k9Y BXOLsnppRt01xeZLpz4MH6ny6YDx06FXZsHYAnJYVV6+IcZDpAgJ4Oxfsu83JGk7D1hj D1lDeNbQhvGHHX8fOmpZqSYBY7g0T5nzgTZa8xUgHmzrkLhcbfkACDNK7YMdD1PVTmvz bR7FYubZ3oXciQ9DBrkcOExWWQCpftr1GqNhajZ5yXxW/uPpivzD1hMV9BIdgmtxqOCb Q+tL6QmvVTrY6scryMTjJZjBWMI+JFxNIHs55GqSILbVRwsF5i3mxglw5pzfz5s7hysA hnlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471557; x=1700076357; 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=snqi9ZAb69U97s+7VMf1BAq4rrxCeqGoe37aqQ1Toc8=; b=XFrKV9f78Q79nRtnIG6XflAlnoTxXsLVw4tvYeT8D0q/QlbJHqOG2IHK5DkhGTiMZg Mxd8fIvY/6V82ZPtwbKhm/rJXjbR/rrmxmUBaYovpAHbNvfhYRi/cXZz5lDCTq7sH7JS 8nqQ4OV7JKhcCWZlv130xbPbvq5fexAByUk5hLqdUnbtBDoURQQNPClvcIZTHFqxP8xJ zsxf/kGxydyRR586pZEMZ/yObNoRgazY/YI8bDGPMc7B8HwSz5s4gkDlcFNr56holRf/ vlMZEb7Ph5mtQIzYPJLbZH1TKkCxotuIYAh9wVq5pfgpCVf6VYEuDTsle7TVGeIqVTbY HVFQ== X-Gm-Message-State: AOJu0Yx2g3YMkycM3sE0dPQd2tCQotIr7vsvWClYV6JhyID2vwanYUnD 7qr+WWdAeAd9eV2Gzgq/RVc= X-Google-Smtp-Source: AGHT+IHOdgC5Eo1b0x/HXnmQLZLgaNvSBG1RL64XH8JNoNzfiwEon06B2VtPqxqrKJjdOv1oaQTcMw== X-Received: by 2002:adf:fd04:0:b0:32d:8be4:df83 with SMTP id e4-20020adffd04000000b0032d8be4df83mr2221742wrr.36.1699471557604; Wed, 08 Nov 2023 11:25:57 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id s12-20020a5d6a8c000000b0032db8f7f378sm5626782wru.71.2023.11.08.11.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:25:56 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Ferruh Yigit , David Marchand , dpdk stable Subject: patch 'app/testpmd: fix early exit from signal' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:07 +0000 Message-Id: <20231108192535.922238-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108192535.922238-1-luca.boccassi@gmail.com> References: <20231018235930.3144-41-luca.boccassi@gmail.com> <20231108192535.922238-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/14d0084034451375f62e3ae03de173fbdcdbd19c Thanks. Luca Boccassi --- >From 14d0084034451375f62e3ae03de173fbdcdbd19c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 26 Oct 2023 10:11:33 -0700 Subject: [PATCH] app/testpmd: fix early exit from signal [ upstream commit a996cd04aeeaeca88e6313174101a1229349fb47 ] Other signals may occur causing read to get interrupted. Loop until quit flag is set by signal, a character is entered, or end of file. This fixes bug where testpmd would exit early because of signal used by TAP device. Bugzilla ID: 1305 Fixes: 0fd1386c30c3 ("app/testpmd: cleanup cleanly from signal") Signed-off-by: Stephen Hemminger Acked-by: Ferruh Yigit Reviewed-by: David Marchand --- app/test-pmd/testpmd.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 568b9f7390..4fa8284a0e 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -4059,25 +4058,17 @@ main(int argc, char** argv) } } else { char c; - fd_set fds; printf("Press enter to exit\n"); - - FD_ZERO(&fds); - FD_SET(0, &fds); - - /* wait for signal or enter */ - ret = select(1, &fds, NULL, NULL, NULL); - if (ret < 0 && errno != EINTR) - rte_exit(EXIT_FAILURE, - "Select failed: %s\n", - strerror(errno)); - - /* if got enter then consume it */ - if (ret == 1 && read(0, &c, 1) < 0) - rte_exit(EXIT_FAILURE, - "Read failed: %s\n", + while (f_quit == 0) { + /* end-of-file or any character exits loop */ + if (read(0, &c, 1) >= 0) + break; + if (errno == EINTR) + continue; + rte_exit(EXIT_FAILURE, "Read failed: %s\n", strerror(errno)); + } } } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:52.388614698 +0000 +++ 0009-app-testpmd-fix-early-exit-from-signal.patch 2023-11-08 19:23:51.745395713 +0000 @@ -1 +1 @@ -From a996cd04aeeaeca88e6313174101a1229349fb47 Mon Sep 17 00:00:00 2001 +From 14d0084034451375f62e3ae03de173fbdcdbd19c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a996cd04aeeaeca88e6313174101a1229349fb47 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 595b77748c..9e4e99e53b 100644 +index 568b9f7390..4fa8284a0e 100644 @@ -26 +27,2 @@ -@@ -11,7 +11,6 @@ +@@ -10,7 +10,6 @@ + #include @@ -28 +29,0 @@ - #ifndef RTE_EXEC_ENV_WINDOWS @@ -31 +31,0 @@ - #endif @@ -34 +34,2 @@ -@@ -4743,25 +4742,17 @@ main(int argc, char** argv) + #include +@@ -4059,25 +4058,17 @@ main(int argc, char** argv)