diff mbox series

[v1,8/9] test: skip pktio_perf tests on 1 and 2 cpus machines

Message ID 1500026405-14155-9-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/9] bug: linux-generic: add syntax to allow newer clang to compile odp | expand

Commit Message

Github ODP bot July 14, 2017, 10 a.m. UTC
From: Maxim Uvarov <maxim.uvarov@linaro.org>


Make check should skip the test instead of failing it.
Test splits RX and TX cores for packet processing. Core
0 bind to control thread. So running machine should have
at least 2 worker threads which is not enough on 1 and 2
cpus machine. CUnit uses special value 77 to mark test as
SKIPPED and not fail on it.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>

---
/** Email created from pull request 77 (muvarov:monarch_lts)
 ** https://github.com/Linaro/odp/pull/77
 ** Patch: https://github.com/Linaro/odp/pull/77.patch
 ** Base sha: 0c15c40db40834f1df217191c4b6a06303ab0872
 ** Merge commit sha: f06a7319a03ad565ced026ddc76a66164aa93782
 **/
 test/performance/odp_pktio_perf.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index 18a1aa2a..988f298b 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -34,6 +34,8 @@ 
 #include <inttypes.h>
 #include <test_debug.h>
 
+#define TEST_SKIP 77
+
 #define PKT_BUF_NUM       8192
 #define MAX_NUM_IFACES    2
 #define TEST_HDR_MAGIC    0x92749451
@@ -558,7 +560,7 @@  static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
 					   gbl_args->args.cpu_count);
 	if (num_workers < 2) {
 		LOG_ERR("Need at least two cores\n");
-		return -1;
+		return TEST_SKIP;
 	}
 
 	if (gbl_args->args.num_tx_workers) {
@@ -659,7 +661,7 @@  static int run_test_single(odp_cpumask_t *thd_mask_tx,
 
 static int run_test(void)
 {
-	int ret = 1;
+	int ret;
 	int i;
 	odp_cpumask_t txmask, rxmask;
 	test_status_t status = {
@@ -669,8 +671,9 @@  static int run_test(void)
 		.warmup = 1,
 	};
 
-	if (setup_txrx_masks(&txmask, &rxmask) != 0)
-		return -1;
+	ret = setup_txrx_masks(&txmask, &rxmask);
+	if (ret)
+		return ret;
 
 	printf("Starting test with params:\n");
 	printf("\tTransmit workers:     \t%d\n", odp_cpumask_count(&txmask));
@@ -691,8 +694,11 @@  static int run_test(void)
 	run_test_single(&txmask, &rxmask, &status);
 	status.warmup = 0;
 
-	while (ret > 0)
+	while (1) {
 		ret = run_test_single(&txmask, &rxmask, &status);
+		if (ret <= 0)
+			break;
+	}
 
 	return ret;
 }