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 7F947A04AF for ; Thu, 20 Aug 2020 17:34:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 752A71C0C1; Thu, 20 Aug 2020 17:34:32 +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 836481BEC4 for ; Thu, 20 Aug 2020 17:34:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597937670; 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: in-reply-to:in-reply-to:references:references; bh=fWc5mXaThBa08cuJjrs7ZrqKdRmC/C+zbromJ9jMslg=; b=ivGjFAWaJQyMnvK+4dP6IH62VWevU/idthfbtbED+pa8tdXmoqSsDBZQnRi82A6cDp5+y1 VINOXcehx/asT0uClC2LrN/h22Gv5ViGt07T62alVkNYNfn6qLcHYu2VCPX3G7YGHfodMV FPY6WTMhL+HY/HO5fUIuuUMtG8RLVgg= 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-152-VN3pUNMGOhq94U8xCAhfQw-1; Thu, 20 Aug 2020 11:34:26 -0400 X-MC-Unique: VN3pUNMGOhq94U8xCAhfQw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17FBE1084C92; Thu, 20 Aug 2020 15:34:25 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DCE310027A6; Thu, 20 Aug 2020 15:34:23 +0000 (UTC) From: Kevin Traynor To: Honnappa Nagarahalli Cc: Phil Yang , Ruifeng Wang , Ferruh Yigit , Ali Alnubani , dpdk stable Date: Thu, 20 Aug 2020 16:33:21 +0100 Message-Id: <20200820153341.171927-16-ktraynor@redhat.com> In-Reply-To: <20200820153341.171927-1-ktraynor@redhat.com> References: <20200820153341.171927-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 burst percentage calculation' 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 08/25/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/f1b7643e624b44873ae9673d14cf57c0fd277639 Thanks. Kevin. --- >From f1b7643e624b44873ae9673d14cf57c0fd277639 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Mon, 6 Jul 2020 18:32:30 -0500 Subject: [PATCH] app/testpmd: fix burst percentage calculation [ upstream commit 85de481a716a14a3eb89869928d96b539b1f0b62 ] The burst % calculation can over flow due to multiplication. Fix the multiplication and increase the size of variables to 64b. Fixes: af75078fece3 ("first public release") Signed-off-by: Honnappa Nagarahalli Reviewed-by: Phil Yang Reviewed-by: Ruifeng Wang Reviewed-by: Ferruh Yigit Tested-by: Phil Yang Tested-by: Ali Alnubani --- app/test-pmd/testpmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a32eae750c..018bd32ec6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1326,7 +1326,7 @@ static void pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) { - unsigned int total_burst; - unsigned int nb_burst; - unsigned int burst_stats[3]; + uint64_t total_burst; + uint64_t nb_burst; + uint64_t burst_stats[3]; uint16_t pktnb_stats[3]; uint16_t nb_pkt; @@ -1357,6 +1357,6 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) if (total_burst == 0) return; - burst_percent[0] = (burst_stats[0] * 100) / total_burst; - printf(" %s-bursts : %u [%d%% of %d pkts", rx_tx, total_burst, + burst_percent[0] = (double)burst_stats[0] / total_burst * 100; + printf(" %s-bursts : %"PRIu64" [%d%% of %d pkts", rx_tx, total_burst, burst_percent[0], (int) pktnb_stats[0]); if (burst_stats[0] == total_burst) { @@ -1369,5 +1369,5 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) return; } - burst_percent[1] = (burst_stats[1] * 100) / total_burst; + burst_percent[1] = (double)burst_stats[1] / total_burst * 100; burst_percent[2] = 100 - (burst_percent[0] + burst_percent[1]); if ((burst_percent[1] == 0) || (burst_percent[2] == 0)) { -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-20 16:26:16.469640556 +0100 +++ 0016-app-testpmd-fix-burst-percentage-calculation.patch 2020-08-20 16:26:15.801324115 +0100 @@ -1 +1 @@ -From 85de481a716a14a3eb89869928d96b539b1f0b62 Mon Sep 17 00:00:00 2001 +From f1b7643e624b44873ae9673d14cf57c0fd277639 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 85de481a716a14a3eb89869928d96b539b1f0b62 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 4989d22ca8..2e1493da23 100644 +index a32eae750c..018bd32ec6 100644 @@ -27 +28 @@ -@@ -1693,7 +1693,7 @@ static void +@@ -1326,7 +1326,7 @@ static void @@ -38 +39 @@ -@@ -1724,6 +1724,6 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) +@@ -1357,6 +1357,6 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) @@ -47 +48 @@ -@@ -1736,5 +1736,5 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) +@@ -1369,5 +1369,5 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)