From patchwork Thu May 26 12:51:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 13025 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5754337A2; Thu, 26 May 2016 14:51:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 05D583798 for ; Thu, 26 May 2016 14:51:13 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 26 May 2016 05:51:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,367,1459839600"; d="scan'208";a="709252760" Received: from sie-lab-214-251.ir.intel.com (HELO silpixa373510.ir.intel.com) ([10.237.214.251]) by FMSMGA003.fm.intel.com with ESMTP; 26 May 2016 05:51:11 -0700 From: David Hunt To: dev@dpdk.org Cc: olivier.matz@6wind.com, David Hunt Date: Thu, 26 May 2016 13:51:08 +0100 Message-Id: <1464267068-56805-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] test: fix mempool perf test enq_count wraparound of 32-bit uint X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" recent CPU's can easily wrap around a 32-bit unsigned int in the mempool perf test. Increase to a 64-bit uint. Signed-off-by: David Hunt --- app/test/test_mempool_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index cdc02a0..2f48545 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -110,7 +110,7 @@ static unsigned n_keep; /* number of enqueues / dequeues */ struct mempool_test_stats { - unsigned enq_count; + uint64_t enq_count; } __rte_cache_aligned; static struct mempool_test_stats stats[RTE_MAX_LCORE]; @@ -189,7 +189,7 @@ static int launch_cores(unsigned cores) { unsigned lcore_id; - unsigned rate; + uint64_t rate; int ret; unsigned cores_save = cores; @@ -238,7 +238,7 @@ launch_cores(unsigned cores) for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) rate += (stats[lcore_id].enq_count / TIME_S); - printf("rate_persec=%u\n", rate); + printf("rate_persec=%lu\n", rate); return 0; }