test/ring: fix number of single element enqueue/dequeue

The ring capacity is (RING_SIZE - 1), thus only (RING_SIZE - 1) number of
elements can be enqueued into the ring.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
Feifei Wang 2020-09-20 06:48:51 -05:00 committed by David Marchand
parent 6450023ca2
commit f642148eea

View File

@ -811,7 +811,7 @@ test_ring_basic_ex(void)
printf("%u ring entries are now free\n",
rte_ring_free_count(rp));
for (j = 0; j < RING_SIZE; j++) {
for (j = 0; j < RING_SIZE - 1; j++) {
test_ring_enqueue(rp, obj, esize[i], 1,
TEST_RING_THREAD_DEF | TEST_RING_ELEM_SINGLE);
}
@ -822,7 +822,7 @@ test_ring_basic_ex(void)
goto fail_test;
}
for (j = 0; j < RING_SIZE; j++) {
for (j = 0; j < RING_SIZE - 1; j++) {
test_ring_dequeue(rp, obj, esize[i], 1,
TEST_RING_THREAD_DEF | TEST_RING_ELEM_SINGLE);
}