DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: fix mempool perf test enq_count wraparound of 32-bit uint
@ 2016-05-26 12:51 David Hunt
  2016-05-26 13:48 ` Bruce Richardson
  2016-05-26 14:15 ` [dpdk-dev] [PATCH v2] " David Hunt
  0 siblings, 2 replies; 5+ messages in thread
From: David Hunt @ 2016-05-26 12:51 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, David Hunt

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 <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..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;
 }
-- 
2.5.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] test: fix mempool perf test enq_count wraparound of 32-bit uint
  2016-05-26 12:51 [dpdk-dev] [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 ` [dpdk-dev] [PATCH v2] " David Hunt
  1 sibling, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2016-05-26 13:48 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, olivier.matz

On Thu, May 26, 2016 at 01:51:08PM +0100, David Hunt wrote:
> 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 <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..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);
Use PRIu64 instead of %lu, as %lu is only 32-bit on 32-bit systems.

/Bruce

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] test: fix mempool perf test enq_count wraparound of 32-bit uint
  2016-05-26 12:51 [dpdk-dev] [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
  2016-05-30  8:47   ` Olivier Matz
  1 sibling, 1 reply; 5+ messages in thread
From: David Hunt @ 2016-05-26 14:15 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, David Hunt

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] test: fix mempool perf test enq_count wraparound of 32-bit uint
  2016-05-26 14:15 ` [dpdk-dev] [PATCH v2] " David Hunt
@ 2016-05-30  8:47   ` Olivier Matz
  2016-06-13 20:23     ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier Matz @ 2016-05-30  8:47 UTC (permalink / raw)
  To: David Hunt, dev

Hi David,

On 05/26/2016 04:15 PM, David Hunt wrote:
> 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>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] test: fix mempool perf test enq_count wraparound of 32-bit uint
  2016-05-30  8:47   ` Olivier Matz
@ 2016-06-13 20:23     ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2016-06-13 20:23 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Olivier Matz

> > 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>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-13 20:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 12:51 [dpdk-dev] [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 ` [dpdk-dev] [PATCH v2] " David Hunt
2016-05-30  8:47   ` Olivier Matz
2016-06-13 20:23     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).