test/service: fix wait for service core
[dpdk.git] / app / test / test_service_cores.c
index ec31882..a922c7d 100644 (file)
@@ -259,7 +259,7 @@ service_attr_get(void)
        rte_service_set_stats_enable(id, 1);
 
        uint32_t attr_id = UINT32_MAX;
-       uint32_t attr_value = 0xdead;
+       uint64_t attr_value = 0xdead;
        /* check error return values */
        TEST_ASSERT_EQUAL(-EINVAL, rte_service_attr_get(id, attr_id,
                                                        &attr_value),
@@ -483,7 +483,7 @@ service_lcore_en_dis_able(void)
        int ret = rte_eal_remote_launch(service_remote_launch_func, NULL,
                                        slcore_id);
        TEST_ASSERT_EQUAL(0, ret, "Ex-service core remote launch failed.");
-       rte_eal_mp_wait_lcore();
+       rte_eal_wait_lcore(slcore_id);
        TEST_ASSERT_EQUAL(1, service_remote_launch_flag,
                        "Ex-service core function call had no effect.");
 
@@ -502,6 +502,10 @@ service_lcore_running_check(void)
 static int
 service_lcore_add_del(void)
 {
+       if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1) ||
+           !rte_lcore_is_enabled(2) || !rte_lcore_is_enabled(3))
+               return TEST_SKIPPED;
+
        /* check initial count */
        TEST_ASSERT_EQUAL(0, rte_service_lcore_count(),
                        "Service lcore count has value before adding a lcore");
@@ -669,6 +673,11 @@ static int
 service_mt_safe_poll(void)
 {
        int mt_safe = 1;
+
+       if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1) ||
+           !rte_lcore_is_enabled(2))
+               return TEST_SKIPPED;
+
        TEST_ASSERT_EQUAL(1, service_threaded_test(mt_safe),
                        "Error: MT Safe service not run by two cores concurrently");
        return TEST_SUCCESS;
@@ -681,6 +690,11 @@ static int
 service_mt_unsafe_poll(void)
 {
        int mt_safe = 0;
+
+       if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1) ||
+           !rte_lcore_is_enabled(2))
+               return TEST_SKIPPED;
+
        TEST_ASSERT_EQUAL(1, service_threaded_test(mt_safe),
                        "Error: NON MT Safe service run by two cores concurrently");
        return TEST_SUCCESS;