Patch Detail
Show a patch.
GET /api/patches/73351/
https://patches.dpdk.org/api/patches/73351/", "web_url": "https://patches.dpdk.org/patch/73351/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk" }, "msgid": "<20200706233231.25881-2-honnappa.nagarahalli@arm.com>", "date": "2020-07-06T23:32:30", "name": "[v3,2/3] app/testpmd: fix burst percentage calculation", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "8f3cb2b784485d163daa6e1f8a14080a95379e03", "submitter": { "id": 1045, "url": "https://patches.dpdk.org/api/people/1045/", "name": "Honnappa Nagarahalli", "email": "honnappa.nagarahalli@arm.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@intel.com" }, "mbox": "https://patches.dpdk.org/patch/73351/mbox/", "series": [ { "id": 10827, "url": "https://patches.dpdk.org/api/series/10827/", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10827", "date": "2020-07-06T23:32:29", "name": "[v3,1/3] app/testpmd: clock gettime call in throughput calculation", "version": 3, "mbox": "https://patches.dpdk.org/series/10827/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/73351/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/73351/checks/", "tags": {}, "headers": { "X-Mailer": "git-send-email 2.17.1", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "Date": "Mon, 6 Jul 2020 18:32:30 -0500", "X-Mailman-Version": "2.1.15", "Delivered-To": "patchwork@inbox.dpdk.org", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Cc": "hemant.agrawal@nxp.com, jerinj@marvell.com, viacheslavo@mellanox.com,\n thomas@monjalon.net, ruifeng.wang@arm.com, phil.yang@arm.com, nd@arm.com,\n stable@dpdk.org", "To": "dev@dpdk.org, honnappa.nagarahalli@arm.com, alialnu@mellanox.com,\n orgerlitz@mellanox.com, wenzhuo.lu@intel.com, beilei.xing@intel.com,\n bernard.iremonger@intel.com, ferruh.yigit@intel.com", "Errors-To": "dev-bounces@dpdk.org", "References": "<20200617144307.9961-1-honnappa.nagarahalli@arm.com>\n <20200706233231.25881-1-honnappa.nagarahalli@arm.com>", "Sender": "\"dev\" <dev-bounces@dpdk.org>", "Return-Path": "<dev-bounces@dpdk.org>", "X-BeenThere": "dev@dpdk.org", "List-Post": "<mailto:dev@dpdk.org>", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 46F0CA00C5;\n\tTue, 7 Jul 2020 01:32:49 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DA5F91DC7D;\n\tTue, 7 Jul 2020 01:32:42 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 5A02D1DC65;\n Tue, 7 Jul 2020 01:32:41 +0200 (CEST)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB1241045;\n Mon, 6 Jul 2020 16:32:40 -0700 (PDT)", "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.12.27])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A0D0E3F718;\n Mon, 6 Jul 2020 16:32:40 -0700 (PDT)" ], "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "Subject": "[dpdk-dev] [PATCH v3 2/3] app/testpmd: fix burst percentage\n\tcalculation", "In-Reply-To": "<20200706233231.25881-1-honnappa.nagarahalli@arm.com>", "Message-Id": "<20200706233231.25881-2-honnappa.nagarahalli@arm.com>", "Precedence": "list", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "X-Original-To": "patchwork@inbox.dpdk.org" }, "content": "The burst % calculation can over flow due to multiplication.\nFix the multiplication and increase the size of variables to\n64b.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>\nTested-by: Phil Yang <phil.yang@arm.com>\nTested-by: Ali Alnubani <alialnu@mellanox.com>\n---\n app/test-pmd/testpmd.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)", "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 4989d22ca..2e1493da2 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1692,9 +1692,9 @@ init_fwd_streams(void)\n static void\n pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)\n {\n-\tunsigned int total_burst;\n-\tunsigned int nb_burst;\n-\tunsigned int burst_stats[3];\n+\tuint64_t total_burst;\n+\tuint64_t nb_burst;\n+\tuint64_t burst_stats[3];\n \tuint16_t pktnb_stats[3];\n \tuint16_t nb_pkt;\n \tint burst_percent[3];\n@@ -1723,8 +1723,8 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)\n \t}\n \tif (total_burst == 0)\n \t\treturn;\n-\tburst_percent[0] = (burst_stats[0] * 100) / total_burst;\n-\tprintf(\" %s-bursts : %u [%d%% of %d pkts\", rx_tx, total_burst,\n+\tburst_percent[0] = (double)burst_stats[0] / total_burst * 100;\n+\tprintf(\" %s-bursts : %\"PRIu64\" [%d%% of %d pkts\", rx_tx, total_burst,\n \t burst_percent[0], (int) pktnb_stats[0]);\n \tif (burst_stats[0] == total_burst) {\n \t\tprintf(\"]\\n\");\n@@ -1735,7 +1735,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)\n \t\t 100 - burst_percent[0], pktnb_stats[1]);\n \t\treturn;\n \t}\n-\tburst_percent[1] = (burst_stats[1] * 100) / total_burst;\n+\tburst_percent[1] = (double)burst_stats[1] / total_burst * 100;\n \tburst_percent[2] = 100 - (burst_percent[0] + burst_percent[1]);\n \tif ((burst_percent[1] == 0) || (burst_percent[2] == 0)) {\n \t\tprintf(\" + %d%% of others]\\n\", 100 - burst_percent[0]);\n", "prefixes": [ "v3", "2/3" ] }{ "id": 73351, "url": "