All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, David Hunt <david.hunt@intel.com>
Subject: [PATCH v2] test: fix mempool perf test enq_count wraparound of 32-bit uint
Date: Thu, 26 May 2016 15:15:54 +0100	[thread overview]
Message-ID: <1464272154-94512-1-git-send-email-david.hunt@intel.com> (raw)
In-Reply-To: <1464267068-56805-1-git-send-email-david.hunt@intel.com>

recent CPU's can easily wrap around a 32-bit unsigned int in
the mempool perf test. Increase to a 64-bit uint.

v2: change from %lu to %"PRIu64"

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 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..0fc8110 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=%"PRIu64"\n", rate);
 
 	return 0;
 }
-- 
2.5.5

  parent reply	other threads:[~2016-05-26 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 12:51 [PATCH] test: fix mempool perf test enq_count wraparound of 32-bit uint David Hunt
2016-05-26 13:48 ` Bruce Richardson
2016-05-26 14:15 ` David Hunt [this message]
2016-05-30  8:47   ` [PATCH v2] " Olivier Matz
2016-06-13 20:23     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464272154-94512-1-git-send-email-david.hunt@intel.com \
    --to=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.