From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33FEBA0518 for ; Fri, 24 Jul 2020 14:01:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 281811C031; Fri, 24 Jul 2020 14:01:48 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id BB3941C038 for ; Fri, 24 Jul 2020 14:01:46 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id q5so8069765wru.6 for ; Fri, 24 Jul 2020 05:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XeeNTKz45+JDRXs4BEFnu7XrtNnTJp+Bk/bI93EBQ/o=; b=M2h+dk3+1zLMIpxGYQwYfONYP7o0MwtXWSq9edlQqtMsQNQR+b5xEs7EIUFeIwmDsa 83w8S+YLeyu3e7nMqKdU2jawtyrqqB3wDbF9JQ9WCEews9o5L97nx28c8hgOHLtlpzNm E0R84P89th1QcIhMxJtEcPfNOBDnMu43CrzccsebPIH7ZPG9WWhZTEKY9aoIGBGMtn+Z n/v/byM3LPke/xeLqEJxGBu/DXr5q3ONBO6FZH5sD3jCFkn+mpIn5vN2zhNDX1KskvXa 49b6eKxfTnhR0VWG8eETaEppl63wovHeXNLxAYkc92QrgRpHbAV/2d65vSqJVmbGO5MW 0zLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XeeNTKz45+JDRXs4BEFnu7XrtNnTJp+Bk/bI93EBQ/o=; b=uNmQzvMJ2DaFdvs6ERtydVW199OnDpoKHWVRGkJPJBQ8WLNLSCS4dvdYwehOKbQ/9a vHZI3lsVPDzFAC9NTEJTFIwYEOlFx7cDKzuHb72gPLBtRscsCh1b9rzLeHzD2YtHLvJZ 20lUp2DBaDMjvf68KsribQsECJvUw5kHMjD5JXcSrPzxNA388/Rm0kQ1F9/VAYkGg9Q6 Ef41qX6epnoRRSqF4mVKwMwhMIT9lKKigS1miJQADPciZs6cHnZ0+UcVQrH8VGveK8do RggGd5bH2J1fEN3f2pWqfB26bxJns+xk1BfkxcWqDLXoHVRZutxjywyR/wdwuvJXAdQ+ 5cCA== X-Gm-Message-State: AOAM530mDd5FjzD3V6BafmMYWsrbdaD59YtqeNNMTVS+vuuzPvijgHrb oz7pSUQPBfvv7JYl4Jmt1dI= X-Google-Smtp-Source: ABdhPJwpEE/I7GmQIMOwQfn3lL4nSElz7/HWeJeGwpZRcyDSh1i5Mn3ZqF3XRNhsSTq2EOKRTeFc3g== X-Received: by 2002:adf:ce89:: with SMTP id r9mr5845655wrn.116.1595592106506; Fri, 24 Jul 2020 05:01:46 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id s203sm7199483wms.32.2020.07.24.05.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:01:45 -0700 (PDT) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Ferruh Yigit , dpdk stable Date: Fri, 24 Jul 2020 12:57:40 +0100 Message-Id: <20200724120030.1863487-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. 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. Thanks. Luca Boccassi --- >From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Sat, 6 Jun 2020 11:46:37 +0800 Subject: [PATCH] app/testpmd: fix stats error message [ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ] There are coverity defects related "Argument cannot be negative" This patch fixes them by passing '-ret' to the function strerror() when ret is negative. Coverity issue: 349913, 358437, 358449, 358450 Fixes: da328f7f115a ("ethdev: change xstats reset function to return int") Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset") Signed-off-by: Wei Hu (Xavier) Reviewed-by: Ferruh Yigit --- app/test-pmd/config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 42eba68b3..d5d246617 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id) ret = rte_eth_stats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset stats (port %u): %s", - __func__, port_id, strerror(ret)); + __func__, port_id, strerror(-ret)); return; } ret = rte_eth_stats_get(port_id, &ports[port_id].stats); if (ret != 0) { + if (ret < 0) + ret = -ret; printf("%s: Error: failed to get stats (port %u): %s", __func__, port_id, strerror(ret)); return; @@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id) ret = rte_eth_xstats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset xstats (port %u): %s", - __func__, port_id, strerror(ret)); + __func__, port_id, strerror(-ret)); return; } ret = rte_eth_stats_get(port_id, &ports[port_id].stats); if (ret != 0) { + if (ret < 0) + ret = -ret; printf("%s: Error: failed to get stats (port %u): %s", __func__, port_id, strerror(ret)); return; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:49.469273842 +0100 +++ 0022-app-testpmd-fix-stats-error-message.patch 2020-07-24 12:53:48.207004969 +0100 @@ -1,8 +1,10 @@ -From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001 +From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Sat, 6 Jun 2020 11:46:37 +0800 Subject: [PATCH] app/testpmd: fix stats error message +[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ] + There are coverity defects related "Argument cannot be negative" This patch fixes them by passing '-ret' to the function strerror() when @@ -11,7 +13,6 @@ Coverity issue: 349913, 358437, 358449, 358450 Fixes: da328f7f115a ("ethdev: change xstats reset function to return int") Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset") -Cc: stable@dpdk.org Signed-off-by: Wei Hu (Xavier) Reviewed-by: Ferruh Yigit @@ -20,10 +21,10 @@ 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c -index 5381207cc..016bcb09c 100644 +index 42eba68b3..d5d246617 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c -@@ -244,12 +244,14 @@ nic_stats_clear(portid_t port_id) +@@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id) ret = rte_eth_stats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset stats (port %u): %s", @@ -39,7 +40,7 @@ printf("%s: Error: failed to get stats (port %u): %s", __func__, port_id, strerror(ret)); return; -@@ -333,12 +335,14 @@ nic_xstats_clear(portid_t port_id) +@@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id) ret = rte_eth_xstats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset xstats (port %u): %s",