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 759A9A04B7 for ; Wed, 2 Sep 2020 11:12:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 614EAE07; Wed, 2 Sep 2020 11:12:20 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id DDCE7E07 for ; Wed, 2 Sep 2020 11:12:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599037938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QeW/7Dp04tnB0Ht02B2cOWRmtcFi1izqIv2mWBr81v8=; b=CoDFwaeT/z1HvxHa8Hd8At6nGZz+JEHaVan51u1rD5AromLokPZyY/wRTvdXKBpLKdmfn6 DfLliV/Sk6bdUBN1QRwHpq/uvYQzCDDdvLwqmbSZ/8LSA+vVkWw8BIZFgeARWjQgHxqbGm 5w47OGY2FKBNZlPyGTF+rMz4sagB0vU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-3cKd6CfNMtiWwntGHtJR6w-1; Wed, 02 Sep 2020 05:12:13 -0400 X-MC-Unique: 3cKd6CfNMtiWwntGHtJR6w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C04098015B0; Wed, 2 Sep 2020 09:12:12 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADAD35D9CC; Wed, 2 Sep 2020 09:12:11 +0000 (UTC) From: Kevin Traynor To: "Wei Hu (Xavier)" Cc: Ferruh Yigit , dpdk stable Date: Wed, 2 Sep 2020 10:12:00 +0100 Message-Id: <20200902091201.123509-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10 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 LTS release 18.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 09/04/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/16e7a4b710d001d91f8b60b91ee83966dcad447b Thanks. Kevin. --- >From 16e7a4b710d001d91f8b60b91ee83966dcad447b 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index b51e821a45..3b588e2042 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -232,5 +232,5 @@ nic_stats_clear(portid_t 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; } @@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id) 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)); @@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id) return; } - rte_eth_xstats_reset(port_id); 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)); -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-09-02 10:08:36.585681610 +0100 +++ 0001-app-testpmd-fix-stats-error-message.patch 2020-09-02 10:08:36.554496721 +0100 @@ -1 +1 @@ -From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001 +From 16e7a4b710d001d91f8b60b91ee83966dcad447b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -19,2 +20,2 @@ - app/test-pmd/config.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) + app/test-pmd/config.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) @@ -23 +24 @@ -index 5381207cc2..016bcb09c4 100644 +index b51e821a45..3b588e2042 100644 @@ -26 +27 @@ -@@ -245,5 +245,5 @@ nic_stats_clear(portid_t port_id) +@@ -232,5 +232,5 @@ nic_stats_clear(portid_t port_id) @@ -33 +34 @@ -@@ -251,4 +251,6 @@ nic_stats_clear(portid_t port_id) +@@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id) @@ -40,5 +41 @@ -@@ -334,5 +336,5 @@ nic_xstats_clear(portid_t 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)); +@@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id) @@ -47 +44,2 @@ -@@ -340,4 +342,6 @@ nic_xstats_clear(portid_t port_id) +- rte_eth_xstats_reset(port_id); +