[v2,1/4] test/ring: fix wrong parameter passed to the enqueue APIs
diff mbox series

Message ID 20200805061421.13037-2-feifei.wang2@arm.com
State Superseded
Delegated to: David Marchand
Headers show
Series
  • wrong pointer passed and add check
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Feifei Wang Aug. 5, 2020, 6:14 a.m. UTC
When enqueue one element to ring in the performance test, a pointer
should be passed to rte_ring_[sp|mp]enqueue APIs, not the pointer
to a table of void *pointers.

Fixes: a9fe152363e2 ("test/ring: add custom element size functional tests")
Cc: honnappa.nagarahalli@arm.com
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 app/test/test_ring.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/app/test/test_ring.h b/app/test/test_ring.h
index aa6ae67ca..d4b15af7c 100644
--- a/app/test/test_ring.h
+++ b/app/test/test_ring.h
@@ -50,11 +50,11 @@  test_ring_enqueue(struct rte_ring *r, void **obj, int esize, unsigned int n,
 	if ((esize) == -1)
 		switch (api_type) {
 		case (TEST_RING_THREAD_DEF | TEST_RING_ELEM_SINGLE):
-			return rte_ring_enqueue(r, obj);
+			return rte_ring_enqueue(r, *obj);
 		case (TEST_RING_THREAD_SPSC | TEST_RING_ELEM_SINGLE):
-			return rte_ring_sp_enqueue(r, obj);
+			return rte_ring_sp_enqueue(r, *obj);
 		case (TEST_RING_THREAD_MPMC | TEST_RING_ELEM_SINGLE):
-			return rte_ring_mp_enqueue(r, obj);
+			return rte_ring_mp_enqueue(r, *obj);
 		case (TEST_RING_THREAD_DEF | TEST_RING_ELEM_BULK):
 			return rte_ring_enqueue_bulk(r, obj, n, NULL);
 		case (TEST_RING_THREAD_SPSC | TEST_RING_ELEM_BULK):