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 1DF0841EA5 for ; Wed, 15 Mar 2023 23:47:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A28840A7A; Wed, 15 Mar 2023 23:47:38 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 3637640FDF for ; Wed, 15 Mar 2023 23:47:36 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id t15so18687865wrz.7 for ; Wed, 15 Mar 2023 15:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920456; 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=s/63uB/HhTEDur59D8+x5hbRP9ys4emy0oR3nhspeH8=; b=L6NO5EZ/c985zHKx7CEgZSTnjWDh9MxpZizKFGbRv2Gh83pN8x3LMlLOWuCioX0W55 Bt7YERDoA1uLJQLjyfq0PGnn+H4GGObbTOXOIOIqjvtBUiFAewEtFymMz6SESYcf+klo a6OYRXk5MNoUQCuFGz28d4AJ+RfJkeH3sjHBMU8B0PtolGxq8gxhFlncgTaLiZbm0gYY RCAQOkXE16QNvphiuqibKhYg91/GVTnbFZ+08J96uxTXjsntJBlA4kxbAvA+boeNEgNj GCsrtzvm59YmG7GzLB0pKdvYbE1rLhOGx3Iln0EW+fnrmIBiAUc/WUMrAg8f3zD13fmM 8t6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920456; 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=s/63uB/HhTEDur59D8+x5hbRP9ys4emy0oR3nhspeH8=; b=kmT2BZxEiAqjJmaJslKS6bfI0DgPNNiCzj5c0uNG84exvYxnpx9s9zXtOr/9FopCbt aHCp7GohWiIoEBhWYeW0jvYUBmBONnA7u+wE4z2DI7+TkrRvRXHpJi3k8ujA2VK3NFUI TiWbRknnaaE/RP3sIFRZRbOcUZoFX8LDXfk0vcOCojHGYjvtLzspvMC0J5UPFjWsdhHj lxlmUrani2ht5UBXK8L78cW1s74LlLFVDrZnmnvl/EAgMSFG7jvuBjIzZDXroKxxAKRa t+sfC7CoegWBN+kzGTiO6kaBX5A+9FKJ9ox+P8sMCVuZx9MmwGodI8Coih2a14ewVy9i 6X0Q== X-Gm-Message-State: AO0yUKUl6mnyCrXdjCHzwUp4KvNoNre7znp7yAcPrYYotOibrAuvPrAP 8aGUSmGmCczoZjJMxUrEgn4sCTkjeDAZ1g== X-Google-Smtp-Source: AK7set9MmpaiIGw8QZwB4e3+FNRraj8MVlsTipdDGJGzmUJSV+C7A7E8MF6Yoq9yJhgzRgYTDA3Kng== X-Received: by 2002:a5d:4486:0:b0:2ce:aa4e:78d6 with SMTP id j6-20020a5d4486000000b002ceaa4e78d6mr3236022wrq.32.1678920455935; Wed, 15 Mar 2023 15:47:35 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id p18-20020adfe612000000b002c3f9404c45sm5725770wrm.7.2023.03.15.15.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:47:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: dpdk stable Subject: patch 'cmdline: handle EOF as quit' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:13 +0000 Message-Id: <20230315224631.1025649-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315224631.1025649-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-71-luca.boccassi@gmail.com> <20230315224631.1025649-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.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/17/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/665af7d940592cf80b4ba37e18ee20bb547a57af Thanks. Luca Boccassi --- >From 665af7d940592cf80b4ba37e18ee20bb547a57af Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 3 Feb 2023 11:14:08 -0800 Subject: [PATCH] cmdline: handle EOF as quit [ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ] If end of file is reached on input, then cmdline_poll() will return 1 (ie file has something); and then the cmdline_in() call to read will return 0. With the existing code, caller has no way to tell that end of file has been reached and will retry forever. A good way to handle this is to make end of file equivalent to the quit command. Since no more input is possible at that point. Fixes: 067855e651d6 ("cmdline: add polling mode") Signed-off-by: Stephen Hemminger --- lib/librte_cmdline/cmdline.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c index 79ea5f98c8..478bcfb161 100644 --- a/lib/librte_cmdline/cmdline.c +++ b/lib/librte_cmdline/cmdline.c @@ -205,9 +205,14 @@ cmdline_poll(struct cmdline *cl) if (read_status < 0) return read_status; - status = cmdline_in(cl, &c, 1); - if (status < 0 && cl->rdl.status != RDLINE_EXITED) - return status; + if (read_status == 0) { + /* end of file is implicit quit */ + cmdline_quit(cl); + } else { + status = cmdline_in(cl, &c, 1); + if (status < 0 && cl->rdl.status != RDLINE_EXITED) + return status; + } } return cl->rdl.status; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:50.894361820 +0000 +++ 0022-cmdline-handle-EOF-as-quit.patch 2023-03-15 22:44:49.583850261 +0000 @@ -1 +1 @@ -From 415549f1ccce62b82cb182175346904a65f74cec Mon Sep 17 00:00:00 2001 +From 665af7d940592cf80b4ba37e18ee20bb547a57af Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ - lib/cmdline/cmdline.c | 11 ++++++++--- + lib/librte_cmdline/cmdline.c | 11 ++++++++--- @@ -24,5 +25,5 @@ -diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c -index e1009ba4c4..8ad0690d85 100644 ---- a/lib/cmdline/cmdline.c -+++ b/lib/cmdline/cmdline.c -@@ -197,9 +197,14 @@ cmdline_poll(struct cmdline *cl) +diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c +index 79ea5f98c8..478bcfb161 100644 +--- a/lib/librte_cmdline/cmdline.c ++++ b/lib/librte_cmdline/cmdline.c +@@ -205,9 +205,14 @@ cmdline_poll(struct cmdline *cl)