[3/3] test: run lock-free stack tests when supported

Message ID 20210412082901.652736-4-kda@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series add lock-free stack support discovery |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Stanislaw Kardach April 12, 2021, 8:29 a.m. UTC
Use the recently added RTE_STACK_LF_SUPPORTED flag to disable the
lock-free stack tests at the compile time.
Perf test doesn't fail because rte_ring_create() succeeds, however
marking this test as skipped gives a better indication of what actually
was tested.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Cc: stable@dpdk.org
---
 app/test/test_stack.c      | 4 ++++
 app/test/test_stack_perf.c | 4 ++++
 2 files changed, 8 insertions(+)
  

Comments

Olivier Matz April 27, 2021, 1:55 p.m. UTC | #1
On Mon, Apr 12, 2021 at 10:29:01AM +0200, Stanislaw Kardach wrote:
> Use the recently added RTE_STACK_LF_SUPPORTED flag to disable the
> lock-free stack tests at the compile time.
> Perf test doesn't fail because rte_ring_create() succeeds, however
> marking this test as skipped gives a better indication of what actually
> was tested.
> 
> Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
> Cc: stable@dpdk.org

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

Patch

diff --git a/app/test/test_stack.c b/app/test/test_stack.c
index 02422a32d..00efb38e2 100644
--- a/app/test/test_stack.c
+++ b/app/test/test_stack.c
@@ -373,7 +373,11 @@  test_stack(void)
 static int
 test_lf_stack(void)
 {
+#if defined(RTE_STACK_LF_SUPPORTED)
 	return __test_stack(RTE_STACK_F_LF);
+#else
+	return TEST_SKIPPED;
+#endif
 }
 
 REGISTER_TEST_COMMAND(stack_autotest, test_stack);
diff --git a/app/test/test_stack_perf.c b/app/test/test_stack_perf.c
index 3590625c4..4ee40d5d1 100644
--- a/app/test/test_stack_perf.c
+++ b/app/test/test_stack_perf.c
@@ -349,7 +349,11 @@  test_stack_perf(void)
 static int
 test_lf_stack_perf(void)
 {
+#if defined(RTE_STACK_LF_SUPPORTED)
 	return __test_stack_perf(RTE_STACK_F_LF);
+#else
+	return TEST_SKIPPED;
+#endif
 }
 
 REGISTER_TEST_COMMAND(stack_perf_autotest, test_stack_perf);