From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A70EC433E0 for ; Mon, 8 Jun 2020 05:59:03 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id BAC752076A for ; Mon, 8 Jun 2020 05:59:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAC752076A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3EDF51BE90; Mon, 8 Jun 2020 07:59:01 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 1B24E2C6D; Mon, 8 Jun 2020 07:59:00 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7AA9E1FB; Sun, 7 Jun 2020 22:58:59 -0700 (PDT) Received: from net-arm-c2400.shanghai.arm.com (net-arm-c2400.shanghai.arm.com [10.169.40.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5CB733F52E; Sun, 7 Jun 2020 22:58:56 -0700 (PDT) From: Feifei Wang To: Honnappa Nagarahalli , Konstantin Ananyev , Ola Liljedahl , Joyce Kong , Gavin Hu , Ruifeng Wang Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , stable@dpdk.org Date: Mon, 8 Jun 2020 13:58:46 +0800 Message-Id: <20200608055846.46971-1-feifei.wang2@arm.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test/ring_perf: fix error statistics in bulk enq/dequeue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In size 32 bulk ring enq/dequeue performance test, the "Total count" statistics is incorrect. For example, running the test on lcore 25 and lcore 26, the output is as follows: The test command: $sudo ./arm64-armv8a-linuxapp-gcc/app/test -l 25-26 RTE>>ring_perf_autotest Bulk enq/dequeue count on size 32 Core [25] count = 288268 Core [26] count = 288281 Total count (size: 32): 1066323 Fixed it by reset the counter at the beginning of each loop. The revised output is as follows: Bulk enq/dequeue count on size 32 Core [25] count = 285643 Core [26] count = 285688 Total count (size: 32): 571331 Fixes: 759cf9b5632c ("test/ring: enhance mp/mc coverage") Cc: stable@dpdk.org Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Reviewed-by: Phil Yang --- app/test/test_ring_perf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index ee21faf71..ac9bf5608 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -380,7 +380,7 @@ load_loop_fn_16B(void *p) static int run_on_all_cores(struct rte_ring *r, const int esize) { - uint64_t total = 0; + uint64_t total; struct thread_params param; lcore_function_t *lcore_f; unsigned int i, c; @@ -392,6 +392,7 @@ run_on_all_cores(struct rte_ring *r, const int esize) memset(¶m, 0, sizeof(struct thread_params)); for (i = 0; i < RTE_DIM(bulk_sizes); i++) { + total = 0; printf("\nBulk enq/dequeue count on size %u\n", bulk_sizes[i]); param.size = bulk_sizes[i]; param.r = r; -- 2.17.1