X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest%2Ftest_mp_secondary.c;h=ad47d578f22b71f3937a8b79102120bcad0a36fc;hb=42902e810d34038754535cd0883e3621d16f34ae;hp=2ac33f781982c3d795788e050b44532ceba5dfda;hpb=742bde12f3bd008c2f06d744330436d8b1a56720;p=dpdk.git diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index 2ac33f7819..ad47d578f2 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -14,6 +14,16 @@ #include #include #include + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary(void) +{ + printf("mp_secondary not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + #include #include #include @@ -28,27 +38,25 @@ #include #include #include -#include #include #include #include #include -#ifdef RTE_LIBRTE_HASH +#ifdef RTE_LIB_HASH #include #include -#endif /* RTE_LIBRTE_HASH */ +#endif /* RTE_LIB_HASH */ -#ifdef RTE_LIBRTE_LPM +#ifdef RTE_LIB_LPM #include -#endif /* RTE_LIBRTE_LPM */ +#endif /* RTE_LIB_LPM */ #include #include "process.h" -#define launch_proc(ARGV) process_dup(ARGV, \ - sizeof(ARGV)/(sizeof(ARGV[0])), __func__) +#define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__) /* * This function is called in the primary i.e. main test, to spawn off secondary @@ -95,9 +103,16 @@ run_secondary_instances(void) #endif snprintf(coremask, sizeof(coremask), "%x", \ - (1 << rte_get_master_lcore())); + (1 << rte_get_main_lcore())); ret |= launch_proc(argv1); + printf("### Testing rte_mp_disable() reject:\n"); + if (rte_mp_disable()) { + printf("Error: rte_mp_disable() has been accepted\n"); + ret |= -1; + } else { + printf("# Checked rte_mp_disable() is refused\n"); + } ret |= launch_proc(argv2); ret |= !(launch_proc(argv3)); @@ -151,7 +166,7 @@ run_object_creation_tests(void) } printf("# Checked rte_mempool_create() OK\n"); -#ifdef RTE_LIBRTE_HASH +#ifdef RTE_LIB_HASH const struct rte_hash_parameters hash_params = { .name = "test_mp_hash" }; rte_errno=0; if ((rte_hash_create(&hash_params) != NULL) && @@ -171,7 +186,7 @@ run_object_creation_tests(void) printf("# Checked rte_fbk_hash_create() OK\n"); #endif -#ifdef RTE_LIBRTE_LPM +#ifdef RTE_LIB_LPM rte_errno=0; struct rte_lpm_config config; @@ -206,4 +221,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /* !RTE_EXEC_ENV_WINDOWS */ + REGISTER_TEST_COMMAND(multiprocess_autotest, test_mp_secondary);