Test case for rte_rcu_qsbr_get_memsize is written specifically
for 128 threads. Do not use RTE_MAX_LCORE as it changes for
different configurations.

Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count")
Cc: sta...@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com>
Reviewed-by: David Marchand <david.march...@redhat.com>
---
v2
- Changed the test case result validation (David)

 app/test/test_rcu_qsbr.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index ae359a987..1d273e39d 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -89,13 +89,17 @@ test_rcu_qsbr_get_memsize(void)
        sz = rte_rcu_qsbr_get_memsize(0);
        TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 1), "Get Memsize for 0 threads");
 
-       sz = rte_rcu_qsbr_get_memsize(RTE_MAX_LCORE);
+       sz = rte_rcu_qsbr_get_memsize(128);
        /* For 128 threads,
         * for machines with cache line size of 64B - 8384
         * for machines with cache line size of 128 - 16768
         */
-       TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 8384 && sz != 16768),
-               "Get Memsize");
+       if (RTE_CACHE_LINE_SIZE == 64)
+               TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 8384),
+                       "Get Memsize for 128 threads");
+       else if (RTE_CACHE_LINE_SIZE == 128)
+               TEST_RCU_QSBR_RETURN_IF_ERROR((sz != 16768),
+                       "Get Memsize for 128 threads");
 
        return 0;
 }
-- 
2.17.1

Reply via email to