[v4,4/5] test_ring_perf: add non-blocking ring perf test

Message ID 20190128181407.32739-5-gage.eads@intel.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Add non-blocking ring
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Eads, Gage Jan. 28, 2019, 6:14 p.m.
nb_ring_perf_autotest re-uses the ring_perf_autotest code by wrapping its
top-level function with one that takes a 'flags' argument.

Signed-off-by: Gage Eads <gage.eads@intel.com>
---
 test/test/test_ring_perf.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

Patch

diff --git a/test/test/test_ring_perf.c b/test/test/test_ring_perf.c
index ebb3939f5..380c4b4a1 100644
--- a/test/test/test_ring_perf.c
+++ b/test/test/test_ring_perf.c
@@ -1,5 +1,5 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+ * Copyright(c) 2010-2019 Intel Corporation
  */
 
 
@@ -363,12 +363,12 @@  test_bulk_enqueue_dequeue(struct rte_ring *r)
 }
 
 static int
-test_ring_perf(void)
+__test_ring_perf(unsigned int flags)
 {
 	struct lcore_pair cores;
 	struct rte_ring *r = NULL;
 
-	r = rte_ring_create(RING_NAME, RING_SIZE, rte_socket_id(), 0);
+	r = rte_ring_create(RING_NAME, RING_SIZE, rte_socket_id(), flags);
 	if (r == NULL)
 		return -1;
 
@@ -398,4 +398,17 @@  test_ring_perf(void)
 	return 0;
 }
 
+static int
+test_ring_perf(void)
+{
+	return __test_ring_perf(0);
+}
+
+static int
+test_nb_ring_perf(void)
+{
+	return __test_ring_perf(RING_F_NB);
+}
+
 REGISTER_TEST_COMMAND(ring_perf_autotest, test_ring_perf);
+REGISTER_TEST_COMMAND(ring_nb_perf_autotest, test_nb_ring_perf);