Message ID | 1442237730-5251-1-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | Accepted |
Commit | 357e236c64ea4ae3e297cf0be25c96f6654f073c |
Headers | show |
ping. On 09/14/15 16:35, Maxim Uvarov wrote: > Use full default word in api to make function > name more clear. > https://bugs.linaro.org/show_bug.cgi?id=1745 > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> > --- > v2: - merge 1 (api update) and 2 (code fix) patches from v1. > - remove patches 3 and 4 to not support NULL for mask. > > example/classifier/odp_classifier.c | 2 +- > example/generator/odp_generator.c | 4 ++-- > example/ipsec/odp_ipsec.c | 2 +- > example/packet/odp_pktio.c | 2 +- > example/timer/odp_timer_test.c | 2 +- > helper/test/odp_process.c | 2 +- > helper/test/odp_thread.c | 2 +- > include/odp/api/cpumask.h | 4 ++-- > platform/linux-generic/odp_cpumask_task.c | 4 ++-- > test/api_test/odp_common.c | 2 +- > test/performance/odp_atomic.c | 2 +- > test/performance/odp_l2fwd.c | 2 +- > test/performance/odp_pktio_perf.c | 5 +++-- > test/performance/odp_scheduling.c | 2 +- > test/validation/common/odp_cunit_common.c | 2 +- > test/validation/cpumask/cpumask.c | 8 ++++---- > test/validation/scheduler/scheduler.c | 2 +- > test/validation/synchronizers/synchronizers.c | 2 +- > 18 files changed, 26 insertions(+), 25 deletions(-) > > diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c > index 3123936..2d90ae7 100644 > --- a/example/classifier/odp_classifier.c > +++ b/example/classifier/odp_classifier.c > @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) > num_workers = args->cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c > index f7aed76..3bb6c4f 100644 > --- a/example/generator/odp_generator.c > +++ b/example/generator/odp_generator.c > @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) > if (args->appl.cpu_count) > num_workers = args->appl.cpu_count; > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > if (args->appl.mask) { > odp_cpumask_from_str(&cpumask, args->appl.mask); > num_workers = odp_cpumask_count(&cpumask); > @@ -918,7 +918,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) > case 'c': > appl_args->mask = optarg; > odp_cpumask_from_str(&cpumask_args, args->appl.mask); > - num_workers = odp_cpumask_def_worker(&cpumask, 0); > + num_workers = odp_cpumask_default_worker(&cpumask, 0); > odp_cpumask_and(&cpumask_and, &cpumask_args, &cpumask); > if (odp_cpumask_count(&cpumask_and) < > odp_cpumask_count(&cpumask_args)) { > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index 96effe2..998e51d 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -1296,7 +1296,7 @@ main(int argc, char *argv[]) > num_workers = args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c > index df53ea2..ce53ee3 100644 > --- a/example/packet/odp_pktio.c > +++ b/example/packet/odp_pktio.c > @@ -386,7 +386,7 @@ int main(int argc, char *argv[]) > num_workers = args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c > index 49630b0..ce9faf9 100644 > --- a/example/timer/odp_timer_test.c > +++ b/example/timer/odp_timer_test.c > @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) > num_workers = gbls->args.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c > index d3a5943..cb9b328 100644 > --- a/helper/test/odp_process.c > +++ b/helper/test/odp_process.c > @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) > } > > /* discover how many processes this system can support */ > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); > if (num_workers < NUMBER_WORKERS) { > printf("System can only support %d processes and not the %d requested\n", > num_workers, NUMBER_WORKERS); > diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c > index 1de30ab..592f856 100644 > --- a/helper/test/odp_thread.c > +++ b/helper/test/odp_thread.c > @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) > } > > /* discover how many threads this system can support */ > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); > if (num_workers < NUMBER_WORKERS) { > printf("System can only support %d threads and not the %d requested\n", > num_workers, NUMBER_WORKERS); > diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h > index 2ad7fea..4835a6c 100644 > --- a/include/odp/api/cpumask.h > +++ b/include/odp/api/cpumask.h > @@ -203,7 +203,7 @@ int odp_cpumask_next(const odp_cpumask_t *mask, int cpu); > * @param num Number of worker threads, zero for all available CPUs > * @return Actual number of CPUs used to create the mask > */ > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num); > > /** > * Default cpumask for control threads > @@ -215,7 +215,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); > * @param num Number of control threads, zero for all available CPUs > * @return Actual number of CPUs used to create the mask > */ > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num); > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num); > > /** > * @} > diff --git a/platform/linux-generic/odp_cpumask_task.c b/platform/linux-generic/odp_cpumask_task.c > index 665e82a..535891c 100644 > --- a/platform/linux-generic/odp_cpumask_task.c > +++ b/platform/linux-generic/odp_cpumask_task.c > @@ -13,7 +13,7 @@ > #include <odp/cpumask.h> > #include <odp_debug_internal.h> > > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num) > { > int ret, cpu, i; > cpu_set_t cpuset; > @@ -43,7 +43,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) > return cpu; > } > > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num ODP_UNUSED) > { > odp_cpumask_zero(mask); > /* By default all control threads on CPU 0 */ > diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c > index 0dbefa5..681d915 100644 > --- a/test/api_test/odp_common.c > +++ b/test/api_test/odp_common.c > @@ -74,7 +74,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > > diff --git a/test/performance/odp_atomic.c b/test/performance/odp_atomic.c > index eefce06..1402a0c 100644 > --- a/test/performance/odp_atomic.c > +++ b/test/performance/odp_atomic.c > @@ -284,7 +284,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > > diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c > index 64fc1b2..5155599 100644 > --- a/test/performance/odp_l2fwd.c > +++ b/test/performance/odp_l2fwd.c > @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) > num_workers = gbl_args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c > index 709becf..4437008 100644 > --- a/test/performance/odp_pktio_perf.c > +++ b/test/performance/odp_pktio_perf.c > @@ -544,8 +544,9 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx, > int num_workers, num_tx_workers, num_rx_workers; > int i, cpu; > > - num_workers = odp_cpumask_def_worker(&cpumask, > - gbl_args->args.cpu_count); > + num_workers = > + odp_cpumask_default_worker(&cpumask, > + gbl_args->args.cpu_count); > if (num_workers < 2) { > LOG_ERR("Need at least two cores\n"); > return -1; > diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c > index aa68634..73eeb72 100644 > --- a/test/performance/odp_scheduling.c > +++ b/test/performance/odp_scheduling.c > @@ -880,7 +880,7 @@ int main(int argc, char *argv[]) > num_workers = args.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c > index d995ad3..0f79199 100644 > --- a/test/validation/common/odp_cunit_common.c > +++ b/test/validation/common/odp_cunit_common.c > @@ -28,7 +28,7 @@ int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > > return odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c > index 6d57028..d09744a 100644 > --- a/test/validation/cpumask/cpumask.c > +++ b/test/validation/cpumask/cpumask.c > @@ -20,7 +20,7 @@ void cpumask_test_odp_cpumask_def_control(void) > unsigned max_cpus = mask_capacity(); > odp_cpumask_t mask; > > - num = odp_cpumask_def_control(&mask, ALL_AVAILABLE); > + num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num); > @@ -35,7 +35,7 @@ void cpumask_test_odp_cpumask_def_worker(void) > unsigned max_cpus = mask_capacity(); > odp_cpumask_t mask; > > - num = odp_cpumask_def_worker(&mask, ALL_AVAILABLE); > + num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num); > @@ -59,11 +59,11 @@ void cpumask_test_odp_cpumask_def(void) > requested_cpus = available_cpus - 1; > else > requested_cpus = available_cpus; > - num_worker = odp_cpumask_def_worker(&mask, requested_cpus); > + num_worker = odp_cpumask_default_worker(&mask, requested_cpus); > mask_count = odp_cpumask_count(&mask); > CU_ASSERT(mask_count == num_worker); > > - num_control = odp_cpumask_def_control(&mask, 1); > + num_control = odp_cpumask_default_control(&mask, 1); > mask_count = odp_cpumask_count(&mask); > CU_ASSERT(mask_count == num_control); > > diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c > index 1874889..d94de6b 100644 > --- a/test/validation/scheduler/scheduler.c > +++ b/test/validation/scheduler/scheduler.c > @@ -1017,7 +1017,7 @@ int scheduler_suite_init(void) > > memset(globals, 0, sizeof(test_globals_t)); > > - globals->num_workers = odp_cpumask_def_worker(&mask, 0); > + globals->num_workers = odp_cpumask_default_worker(&mask, 0); > if (globals->num_workers > MAX_WORKERS) > globals->num_workers = MAX_WORKERS; > > diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c > index 0a31a40..06977f9 100644 > --- a/test/validation/synchronizers/synchronizers.c > +++ b/test/validation/synchronizers/synchronizers.c > @@ -1082,7 +1082,7 @@ int synchronizers_init(void) > global_mem->g_iterations = MAX_ITERATIONS; > global_mem->g_verbose = VERBOSE; > > - workers_count = odp_cpumask_def_worker(&mask, 0); > + workers_count = odp_cpumask_default_worker(&mask, 0); > > max_threads = (workers_count >= MAX_WORKERS) ? > MAX_WORKERS : workers_count;
On 14.09.15 16:35, Maxim Uvarov wrote: > Use full default word in api to make function > name more clear. > https://bugs.linaro.org/show_bug.cgi?id=1745 > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> > --- > v2: - merge 1 (api update) and 2 (code fix) patches from v1. > - remove patches 3 and 4 to not support NULL for mask. > > example/classifier/odp_classifier.c | 2 +- > example/generator/odp_generator.c | 4 ++-- > example/ipsec/odp_ipsec.c | 2 +- > example/packet/odp_pktio.c | 2 +- > example/timer/odp_timer_test.c | 2 +- > helper/test/odp_process.c | 2 +- > helper/test/odp_thread.c | 2 +- > include/odp/api/cpumask.h | 4 ++-- > platform/linux-generic/odp_cpumask_task.c | 4 ++-- > test/api_test/odp_common.c | 2 +- > test/performance/odp_atomic.c | 2 +- > test/performance/odp_l2fwd.c | 2 +- > test/performance/odp_pktio_perf.c | 5 +++-- > test/performance/odp_scheduling.c | 2 +- > test/validation/common/odp_cunit_common.c | 2 +- > test/validation/cpumask/cpumask.c | 8 ++++---- > test/validation/scheduler/scheduler.c | 2 +- > test/validation/synchronizers/synchronizers.c | 2 +- > 18 files changed, 26 insertions(+), 25 deletions(-) > > diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c > index 3123936..2d90ae7 100644 > --- a/example/classifier/odp_classifier.c > +++ b/example/classifier/odp_classifier.c > @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) > num_workers = args->cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c > index f7aed76..3bb6c4f 100644 > --- a/example/generator/odp_generator.c > +++ b/example/generator/odp_generator.c > @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) > if (args->appl.cpu_count) > num_workers = args->appl.cpu_count; > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > if (args->appl.mask) { > odp_cpumask_from_str(&cpumask, args->appl.mask); > num_workers = odp_cpumask_count(&cpumask); > @@ -918,7 +918,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) > case 'c': > appl_args->mask = optarg; > odp_cpumask_from_str(&cpumask_args, args->appl.mask); > - num_workers = odp_cpumask_def_worker(&cpumask, 0); > + num_workers = odp_cpumask_default_worker(&cpumask, 0); > odp_cpumask_and(&cpumask_and, &cpumask_args, &cpumask); > if (odp_cpumask_count(&cpumask_and) < > odp_cpumask_count(&cpumask_args)) { > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index 96effe2..998e51d 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -1296,7 +1296,7 @@ main(int argc, char *argv[]) > num_workers = args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c > index df53ea2..ce53ee3 100644 > --- a/example/packet/odp_pktio.c > +++ b/example/packet/odp_pktio.c > @@ -386,7 +386,7 @@ int main(int argc, char *argv[]) > num_workers = args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c > index 49630b0..ce9faf9 100644 > --- a/example/timer/odp_timer_test.c > +++ b/example/timer/odp_timer_test.c > @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) > num_workers = gbls->args.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c > index d3a5943..cb9b328 100644 > --- a/helper/test/odp_process.c > +++ b/helper/test/odp_process.c > @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) > } > > /* discover how many processes this system can support */ > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); > if (num_workers < NUMBER_WORKERS) { > printf("System can only support %d processes and not the %d requested\n", > num_workers, NUMBER_WORKERS); > diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c > index 1de30ab..592f856 100644 > --- a/helper/test/odp_thread.c > +++ b/helper/test/odp_thread.c > @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) > } > > /* discover how many threads this system can support */ > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); > if (num_workers < NUMBER_WORKERS) { > printf("System can only support %d threads and not the %d requested\n", > num_workers, NUMBER_WORKERS); > diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h > index 2ad7fea..4835a6c 100644 > --- a/include/odp/api/cpumask.h > +++ b/include/odp/api/cpumask.h > @@ -203,7 +203,7 @@ int odp_cpumask_next(const odp_cpumask_t *mask, int cpu); > * @param num Number of worker threads, zero for all available CPUs > * @return Actual number of CPUs used to create the mask > */ > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num); > > /** > * Default cpumask for control threads > @@ -215,7 +215,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); > * @param num Number of control threads, zero for all available CPUs > * @return Actual number of CPUs used to create the mask > */ > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num); > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num); > > /** > * @} > diff --git a/platform/linux-generic/odp_cpumask_task.c b/platform/linux-generic/odp_cpumask_task.c > index 665e82a..535891c 100644 > --- a/platform/linux-generic/odp_cpumask_task.c > +++ b/platform/linux-generic/odp_cpumask_task.c > @@ -13,7 +13,7 @@ > #include <odp/cpumask.h> > #include <odp_debug_internal.h> > > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num) > { > int ret, cpu, i; > cpu_set_t cpuset; > @@ -43,7 +43,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) > return cpu; > } > > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num ODP_UNUSED) > { > odp_cpumask_zero(mask); > /* By default all control threads on CPU 0 */ > diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c > index 0dbefa5..681d915 100644 > --- a/test/api_test/odp_common.c > +++ b/test/api_test/odp_common.c > @@ -74,7 +74,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > > diff --git a/test/performance/odp_atomic.c b/test/performance/odp_atomic.c > index eefce06..1402a0c 100644 > --- a/test/performance/odp_atomic.c > +++ b/test/performance/odp_atomic.c > @@ -284,7 +284,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > > diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c > index 64fc1b2..5155599 100644 > --- a/test/performance/odp_l2fwd.c > +++ b/test/performance/odp_l2fwd.c > @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) > num_workers = gbl_args->appl.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c > index 709becf..4437008 100644 > --- a/test/performance/odp_pktio_perf.c > +++ b/test/performance/odp_pktio_perf.c > @@ -544,8 +544,9 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx, > int num_workers, num_tx_workers, num_rx_workers; > int i, cpu; > > - num_workers = odp_cpumask_def_worker(&cpumask, > - gbl_args->args.cpu_count); > + num_workers = > + odp_cpumask_default_worker(&cpumask, > + gbl_args->args.cpu_count); > if (num_workers < 2) { > LOG_ERR("Need at least two cores\n"); > return -1; > diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c > index aa68634..73eeb72 100644 > --- a/test/performance/odp_scheduling.c > +++ b/test/performance/odp_scheduling.c > @@ -880,7 +880,7 @@ int main(int argc, char *argv[]) > num_workers = args.cpu_count; > > /* Get default worker cpumask */ > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); > > printf("num worker threads: %i\n", num_workers); > diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c > index d995ad3..0f79199 100644 > --- a/test/validation/common/odp_cunit_common.c > +++ b/test/validation/common/odp_cunit_common.c > @@ -28,7 +28,7 @@ int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg) > odp_cpumask_t cpumask; > > /* Create and init additional threads */ > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > > return odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > (void *)arg); > diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c > index 6d57028..d09744a 100644 > --- a/test/validation/cpumask/cpumask.c > +++ b/test/validation/cpumask/cpumask.c > @@ -20,7 +20,7 @@ void cpumask_test_odp_cpumask_def_control(void) > unsigned max_cpus = mask_capacity(); > odp_cpumask_t mask; > > - num = odp_cpumask_def_control(&mask, ALL_AVAILABLE); > + num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num); > @@ -35,7 +35,7 @@ void cpumask_test_odp_cpumask_def_worker(void) > unsigned max_cpus = mask_capacity(); > odp_cpumask_t mask; > > - num = odp_cpumask_def_worker(&mask, ALL_AVAILABLE); > + num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num); > @@ -59,11 +59,11 @@ void cpumask_test_odp_cpumask_def(void) > requested_cpus = available_cpus - 1; > else > requested_cpus = available_cpus; > - num_worker = odp_cpumask_def_worker(&mask, requested_cpus); > + num_worker = odp_cpumask_default_worker(&mask, requested_cpus); > mask_count = odp_cpumask_count(&mask); > CU_ASSERT(mask_count == num_worker); > > - num_control = odp_cpumask_def_control(&mask, 1); > + num_control = odp_cpumask_default_control(&mask, 1); > mask_count = odp_cpumask_count(&mask); > CU_ASSERT(mask_count == num_control); > > diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c > index 1874889..d94de6b 100644 > --- a/test/validation/scheduler/scheduler.c > +++ b/test/validation/scheduler/scheduler.c > @@ -1017,7 +1017,7 @@ int scheduler_suite_init(void) > > memset(globals, 0, sizeof(test_globals_t)); > > - globals->num_workers = odp_cpumask_def_worker(&mask, 0); > + globals->num_workers = odp_cpumask_default_worker(&mask, 0); > if (globals->num_workers > MAX_WORKERS) > globals->num_workers = MAX_WORKERS; > > diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c > index 0a31a40..06977f9 100644 > --- a/test/validation/synchronizers/synchronizers.c > +++ b/test/validation/synchronizers/synchronizers.c > @@ -1082,7 +1082,7 @@ int synchronizers_init(void) > global_mem->g_iterations = MAX_ITERATIONS; > global_mem->g_verbose = VERBOSE; > > - workers_count = odp_cpumask_def_worker(&mask, 0); > + workers_count = odp_cpumask_default_worker(&mask, 0); > > max_threads = (workers_count >= MAX_WORKERS) ? > MAX_WORKERS : workers_count; >
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> > -----Original Message----- > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of > EXT Maxim Uvarov > Sent: Thursday, September 17, 2015 3:28 PM > To: lng-odp-forward > Subject: Re: [lng-odp] [API-NEXT PATCHv2] api: rename odp_cpumask_def > to _default > > ping. > > On 09/14/15 16:35, Maxim Uvarov wrote: > > Use full default word in api to make function > > name more clear. > > https://bugs.linaro.org/show_bug.cgi?id=1745 > > > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> > > --- > > v2: - merge 1 (api update) and 2 (code fix) patches from v1. > > - remove patches 3 and 4 to not support NULL for mask. > > > > example/classifier/odp_classifier.c | 2 +- > > example/generator/odp_generator.c | 4 ++-- > > example/ipsec/odp_ipsec.c | 2 +- > > example/packet/odp_pktio.c | 2 +- > > example/timer/odp_timer_test.c | 2 +- > > helper/test/odp_process.c | 2 +- > > helper/test/odp_thread.c | 2 +- > > include/odp/api/cpumask.h | 4 ++-- > > platform/linux-generic/odp_cpumask_task.c | 4 ++-- > > test/api_test/odp_common.c | 2 +- > > test/performance/odp_atomic.c | 2 +- > > test/performance/odp_l2fwd.c | 2 +- > > test/performance/odp_pktio_perf.c | 5 +++-- > > test/performance/odp_scheduling.c | 2 +- > > test/validation/common/odp_cunit_common.c | 2 +- > > test/validation/cpumask/cpumask.c | 8 ++++---- > > test/validation/scheduler/scheduler.c | 2 +- > > test/validation/synchronizers/synchronizers.c | 2 +- > > 18 files changed, 26 insertions(+), 25 deletions(-) > > > > diff --git a/example/classifier/odp_classifier.c > b/example/classifier/odp_classifier.c > > index 3123936..2d90ae7 100644 > > --- a/example/classifier/odp_classifier.c > > +++ b/example/classifier/odp_classifier.c > > @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) > > num_workers = args->cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/example/generator/odp_generator.c > b/example/generator/odp_generator.c > > index f7aed76..3bb6c4f 100644 > > --- a/example/generator/odp_generator.c > > +++ b/example/generator/odp_generator.c > > @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) > > if (args->appl.cpu_count) > > num_workers = args->appl.cpu_count; > > > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > if (args->appl.mask) { > > odp_cpumask_from_str(&cpumask, args->appl.mask); > > num_workers = odp_cpumask_count(&cpumask); > > @@ -918,7 +918,7 @@ static void parse_args(int argc, char *argv[], > appl_args_t *appl_args) > > case 'c': > > appl_args->mask = optarg; > > odp_cpumask_from_str(&cpumask_args, args->appl.mask); > > - num_workers = odp_cpumask_def_worker(&cpumask, 0); > > + num_workers = odp_cpumask_default_worker(&cpumask, > 0); > > odp_cpumask_and(&cpumask_and, &cpumask_args, > &cpumask); > > if (odp_cpumask_count(&cpumask_and) < > > odp_cpumask_count(&cpumask_args)) { > > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > > index 96effe2..998e51d 100644 > > --- a/example/ipsec/odp_ipsec.c > > +++ b/example/ipsec/odp_ipsec.c > > @@ -1296,7 +1296,7 @@ main(int argc, char *argv[]) > > num_workers = args->appl.cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c > > index df53ea2..ce53ee3 100644 > > --- a/example/packet/odp_pktio.c > > +++ b/example/packet/odp_pktio.c > > @@ -386,7 +386,7 @@ int main(int argc, char *argv[]) > > num_workers = args->appl.cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/example/timer/odp_timer_test.c > b/example/timer/odp_timer_test.c > > index 49630b0..ce9faf9 100644 > > --- a/example/timer/odp_timer_test.c > > +++ b/example/timer/odp_timer_test.c > > @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) > > num_workers = gbls->args.cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c > > index d3a5943..cb9b328 100644 > > --- a/helper/test/odp_process.c > > +++ b/helper/test/odp_process.c > > @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] > TEST_UNUSED) > > } > > > > /* discover how many processes this system can support */ > > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > > + num_workers = odp_cpumask_default_worker(&cpu_mask, > NUMBER_WORKERS); > > if (num_workers < NUMBER_WORKERS) { > > printf("System can only support %d processes and not the %d > requested\n", > > num_workers, NUMBER_WORKERS); > > diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c > > index 1de30ab..592f856 100644 > > --- a/helper/test/odp_thread.c > > +++ b/helper/test/odp_thread.c > > @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] > TEST_UNUSED) > > } > > > > /* discover how many threads this system can support */ > > - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); > > + num_workers = odp_cpumask_default_worker(&cpu_mask, > NUMBER_WORKERS); > > if (num_workers < NUMBER_WORKERS) { > > printf("System can only support %d threads and not the %d > requested\n", > > num_workers, NUMBER_WORKERS); > > diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h > > index 2ad7fea..4835a6c 100644 > > --- a/include/odp/api/cpumask.h > > +++ b/include/odp/api/cpumask.h > > @@ -203,7 +203,7 @@ int odp_cpumask_next(const odp_cpumask_t *mask, > int cpu); > > * @param num Number of worker threads, zero for all > available CPUs > > * @return Actual number of CPUs used to create the mask > > */ > > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); > > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num); > > > > /** > > * Default cpumask for control threads > > @@ -215,7 +215,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, > int num); > > * @param num Number of control threads, zero for all > available CPUs > > * @return Actual number of CPUs used to create the mask > > */ > > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num); > > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num); > > > > /** > > * @} > > diff --git a/platform/linux-generic/odp_cpumask_task.c > b/platform/linux-generic/odp_cpumask_task.c > > index 665e82a..535891c 100644 > > --- a/platform/linux-generic/odp_cpumask_task.c > > +++ b/platform/linux-generic/odp_cpumask_task.c > > @@ -13,7 +13,7 @@ > > #include <odp/cpumask.h> > > #include <odp_debug_internal.h> > > > > -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) > > +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num) > > { > > int ret, cpu, i; > > cpu_set_t cpuset; > > @@ -43,7 +43,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int > num) > > return cpu; > > } > > > > -int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) > > +int odp_cpumask_default_control(odp_cpumask_t *mask, int num > ODP_UNUSED) > > { > > odp_cpumask_zero(mask); > > /* By default all control threads on CPU 0 */ > > diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c > > index 0dbefa5..681d915 100644 > > --- a/test/api_test/odp_common.c > > +++ b/test/api_test/odp_common.c > > @@ -74,7 +74,7 @@ int odp_test_thread_create(void *func_ptr(void *), > pthrd_arg *arg) > > odp_cpumask_t cpumask; > > > > /* Create and init additional threads */ > > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > > (void *)arg); > > > > diff --git a/test/performance/odp_atomic.c > b/test/performance/odp_atomic.c > > index eefce06..1402a0c 100644 > > --- a/test/performance/odp_atomic.c > > +++ b/test/performance/odp_atomic.c > > @@ -284,7 +284,7 @@ int odp_test_thread_create(void *func_ptr(void > *), pthrd_arg *arg) > > odp_cpumask_t cpumask; > > > > /* Create and init additional threads */ > > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > > odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > > (void *)arg); > > > > diff --git a/test/performance/odp_l2fwd.c > b/test/performance/odp_l2fwd.c > > index 64fc1b2..5155599 100644 > > --- a/test/performance/odp_l2fwd.c > > +++ b/test/performance/odp_l2fwd.c > > @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) > > num_workers = gbl_args->appl.cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/test/performance/odp_pktio_perf.c > b/test/performance/odp_pktio_perf.c > > index 709becf..4437008 100644 > > --- a/test/performance/odp_pktio_perf.c > > +++ b/test/performance/odp_pktio_perf.c > > @@ -544,8 +544,9 @@ static int setup_txrx_masks(odp_cpumask_t > *thd_mask_tx, > > int num_workers, num_tx_workers, num_rx_workers; > > int i, cpu; > > > > - num_workers = odp_cpumask_def_worker(&cpumask, > > - gbl_args->args.cpu_count); > > + num_workers = > > + odp_cpumask_default_worker(&cpumask, > > + gbl_args->args.cpu_count); > > if (num_workers < 2) { > > LOG_ERR("Need at least two cores\n"); > > return -1; > > diff --git a/test/performance/odp_scheduling.c > b/test/performance/odp_scheduling.c > > index aa68634..73eeb72 100644 > > --- a/test/performance/odp_scheduling.c > > +++ b/test/performance/odp_scheduling.c > > @@ -880,7 +880,7 @@ int main(int argc, char *argv[]) > > num_workers = args.cpu_count; > > > > /* Get default worker cpumask */ > > - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); > > + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); > > (void)odp_cpumask_to_str(&cpumask, cpumaskstr, > sizeof(cpumaskstr)); > > > > printf("num worker threads: %i\n", num_workers); > > diff --git a/test/validation/common/odp_cunit_common.c > b/test/validation/common/odp_cunit_common.c > > index d995ad3..0f79199 100644 > > --- a/test/validation/common/odp_cunit_common.c > > +++ b/test/validation/common/odp_cunit_common.c > > @@ -28,7 +28,7 @@ int odp_cunit_thread_create(void *func_ptr(void *), > pthrd_arg *arg) > > odp_cpumask_t cpumask; > > > > /* Create and init additional threads */ > > - odp_cpumask_def_worker(&cpumask, arg->numthrds); > > + odp_cpumask_default_worker(&cpumask, arg->numthrds); > > > > return odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, > > (void *)arg); > > diff --git a/test/validation/cpumask/cpumask.c > b/test/validation/cpumask/cpumask.c > > index 6d57028..d09744a 100644 > > --- a/test/validation/cpumask/cpumask.c > > +++ b/test/validation/cpumask/cpumask.c > > @@ -20,7 +20,7 @@ void cpumask_test_odp_cpumask_def_control(void) > > unsigned max_cpus = mask_capacity(); > > odp_cpumask_t mask; > > > > - num = odp_cpumask_def_control(&mask, ALL_AVAILABLE); > > + num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); > > mask_count = odp_cpumask_count(&mask); > > > > CU_ASSERT(mask_count == num); > > @@ -35,7 +35,7 @@ void cpumask_test_odp_cpumask_def_worker(void) > > unsigned max_cpus = mask_capacity(); > > odp_cpumask_t mask; > > > > - num = odp_cpumask_def_worker(&mask, ALL_AVAILABLE); > > + num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); > > mask_count = odp_cpumask_count(&mask); > > > > CU_ASSERT(mask_count == num); > > @@ -59,11 +59,11 @@ void cpumask_test_odp_cpumask_def(void) > > requested_cpus = available_cpus - 1; > > else > > requested_cpus = available_cpus; > > - num_worker = odp_cpumask_def_worker(&mask, requested_cpus); > > + num_worker = odp_cpumask_default_worker(&mask, requested_cpus); > > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num_worker); > > > > - num_control = odp_cpumask_def_control(&mask, 1); > > + num_control = odp_cpumask_default_control(&mask, 1); > > mask_count = odp_cpumask_count(&mask); > > CU_ASSERT(mask_count == num_control); > > > > diff --git a/test/validation/scheduler/scheduler.c > b/test/validation/scheduler/scheduler.c > > index 1874889..d94de6b 100644 > > --- a/test/validation/scheduler/scheduler.c > > +++ b/test/validation/scheduler/scheduler.c > > @@ -1017,7 +1017,7 @@ int scheduler_suite_init(void) > > > > memset(globals, 0, sizeof(test_globals_t)); > > > > - globals->num_workers = odp_cpumask_def_worker(&mask, 0); > > + globals->num_workers = odp_cpumask_default_worker(&mask, 0); > > if (globals->num_workers > MAX_WORKERS) > > globals->num_workers = MAX_WORKERS; > > > > diff --git a/test/validation/synchronizers/synchronizers.c > b/test/validation/synchronizers/synchronizers.c > > index 0a31a40..06977f9 100644 > > --- a/test/validation/synchronizers/synchronizers.c > > +++ b/test/validation/synchronizers/synchronizers.c > > @@ -1082,7 +1082,7 @@ int synchronizers_init(void) > > global_mem->g_iterations = MAX_ITERATIONS; > > global_mem->g_verbose = VERBOSE; > > > > - workers_count = odp_cpumask_def_worker(&mask, 0); > > + workers_count = odp_cpumask_default_worker(&mask, 0); > > > > max_threads = (workers_count >= MAX_WORKERS) ? > > MAX_WORKERS : workers_count; > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp
Merged, Maxim. On 09/17/15 16:35, Savolainen, Petri (Nokia - FI/Espoo) wrote: > Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> > >> -----Original Message----- >> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of >> EXT Maxim Uvarov >> Sent: Thursday, September 17, 2015 3:28 PM >> To: lng-odp-forward >> Subject: Re: [lng-odp] [API-NEXT PATCHv2] api: rename odp_cpumask_def >> to _default >> >> ping. >> >> On 09/14/15 16:35, Maxim Uvarov wrote: >>> Use full default word in api to make function >>> name more clear. >>> https://bugs.linaro.org/show_bug.cgi?id=1745 >>> >>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> >>> --- >>> v2: - merge 1 (api update) and 2 (code fix) patches from v1. >>> - remove patches 3 and 4 to not support NULL for mask. >>> >>> example/classifier/odp_classifier.c | 2 +- >>> example/generator/odp_generator.c | 4 ++-- >>> example/ipsec/odp_ipsec.c | 2 +- >>> example/packet/odp_pktio.c | 2 +- >>> example/timer/odp_timer_test.c | 2 +- >>> helper/test/odp_process.c | 2 +- >>> helper/test/odp_thread.c | 2 +- >>> include/odp/api/cpumask.h | 4 ++-- >>> platform/linux-generic/odp_cpumask_task.c | 4 ++-- >>> test/api_test/odp_common.c | 2 +- >>> test/performance/odp_atomic.c | 2 +- >>> test/performance/odp_l2fwd.c | 2 +- >>> test/performance/odp_pktio_perf.c | 5 +++-- >>> test/performance/odp_scheduling.c | 2 +- >>> test/validation/common/odp_cunit_common.c | 2 +- >>> test/validation/cpumask/cpumask.c | 8 ++++---- >>> test/validation/scheduler/scheduler.c | 2 +- >>> test/validation/synchronizers/synchronizers.c | 2 +- >>> 18 files changed, 26 insertions(+), 25 deletions(-) >>> >>> diff --git a/example/classifier/odp_classifier.c >> b/example/classifier/odp_classifier.c >>> index 3123936..2d90ae7 100644 >>> --- a/example/classifier/odp_classifier.c >>> +++ b/example/classifier/odp_classifier.c >>> @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) >>> num_workers = args->cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/example/generator/odp_generator.c >> b/example/generator/odp_generator.c >>> index f7aed76..3bb6c4f 100644 >>> --- a/example/generator/odp_generator.c >>> +++ b/example/generator/odp_generator.c >>> @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) >>> if (args->appl.cpu_count) >>> num_workers = args->appl.cpu_count; >>> >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> if (args->appl.mask) { >>> odp_cpumask_from_str(&cpumask, args->appl.mask); >>> num_workers = odp_cpumask_count(&cpumask); >>> @@ -918,7 +918,7 @@ static void parse_args(int argc, char *argv[], >> appl_args_t *appl_args) >>> case 'c': >>> appl_args->mask = optarg; >>> odp_cpumask_from_str(&cpumask_args, args->appl.mask); >>> - num_workers = odp_cpumask_def_worker(&cpumask, 0); >>> + num_workers = odp_cpumask_default_worker(&cpumask, >> 0); >>> odp_cpumask_and(&cpumask_and, &cpumask_args, >> &cpumask); >>> if (odp_cpumask_count(&cpumask_and) < >>> odp_cpumask_count(&cpumask_args)) { >>> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >>> index 96effe2..998e51d 100644 >>> --- a/example/ipsec/odp_ipsec.c >>> +++ b/example/ipsec/odp_ipsec.c >>> @@ -1296,7 +1296,7 @@ main(int argc, char *argv[]) >>> num_workers = args->appl.cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c >>> index df53ea2..ce53ee3 100644 >>> --- a/example/packet/odp_pktio.c >>> +++ b/example/packet/odp_pktio.c >>> @@ -386,7 +386,7 @@ int main(int argc, char *argv[]) >>> num_workers = args->appl.cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/example/timer/odp_timer_test.c >> b/example/timer/odp_timer_test.c >>> index 49630b0..ce9faf9 100644 >>> --- a/example/timer/odp_timer_test.c >>> +++ b/example/timer/odp_timer_test.c >>> @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) >>> num_workers = gbls->args.cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c >>> index d3a5943..cb9b328 100644 >>> --- a/helper/test/odp_process.c >>> +++ b/helper/test/odp_process.c >>> @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] >> TEST_UNUSED) >>> } >>> >>> /* discover how many processes this system can support */ >>> - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); >>> + num_workers = odp_cpumask_default_worker(&cpu_mask, >> NUMBER_WORKERS); >>> if (num_workers < NUMBER_WORKERS) { >>> printf("System can only support %d processes and not the %d >> requested\n", >>> num_workers, NUMBER_WORKERS); >>> diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c >>> index 1de30ab..592f856 100644 >>> --- a/helper/test/odp_thread.c >>> +++ b/helper/test/odp_thread.c >>> @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] >> TEST_UNUSED) >>> } >>> >>> /* discover how many threads this system can support */ >>> - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); >>> + num_workers = odp_cpumask_default_worker(&cpu_mask, >> NUMBER_WORKERS); >>> if (num_workers < NUMBER_WORKERS) { >>> printf("System can only support %d threads and not the %d >> requested\n", >>> num_workers, NUMBER_WORKERS); >>> diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h >>> index 2ad7fea..4835a6c 100644 >>> --- a/include/odp/api/cpumask.h >>> +++ b/include/odp/api/cpumask.h >>> @@ -203,7 +203,7 @@ int odp_cpumask_next(const odp_cpumask_t *mask, >> int cpu); >>> * @param num Number of worker threads, zero for all >> available CPUs >>> * @return Actual number of CPUs used to create the mask >>> */ >>> -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); >>> +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num); >>> >>> /** >>> * Default cpumask for control threads >>> @@ -215,7 +215,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, >> int num); >>> * @param num Number of control threads, zero for all >> available CPUs >>> * @return Actual number of CPUs used to create the mask >>> */ >>> -int odp_cpumask_def_control(odp_cpumask_t *mask, int num); >>> +int odp_cpumask_default_control(odp_cpumask_t *mask, int num); >>> >>> /** >>> * @} >>> diff --git a/platform/linux-generic/odp_cpumask_task.c >> b/platform/linux-generic/odp_cpumask_task.c >>> index 665e82a..535891c 100644 >>> --- a/platform/linux-generic/odp_cpumask_task.c >>> +++ b/platform/linux-generic/odp_cpumask_task.c >>> @@ -13,7 +13,7 @@ >>> #include <odp/cpumask.h> >>> #include <odp_debug_internal.h> >>> >>> -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) >>> +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num) >>> { >>> int ret, cpu, i; >>> cpu_set_t cpuset; >>> @@ -43,7 +43,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int >> num) >>> return cpu; >>> } >>> >>> -int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) >>> +int odp_cpumask_default_control(odp_cpumask_t *mask, int num >> ODP_UNUSED) >>> { >>> odp_cpumask_zero(mask); >>> /* By default all control threads on CPU 0 */ >>> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c >>> index 0dbefa5..681d915 100644 >>> --- a/test/api_test/odp_common.c >>> +++ b/test/api_test/odp_common.c >>> @@ -74,7 +74,7 @@ int odp_test_thread_create(void *func_ptr(void *), >> pthrd_arg *arg) >>> odp_cpumask_t cpumask; >>> >>> /* Create and init additional threads */ >>> - odp_cpumask_def_worker(&cpumask, arg->numthrds); >>> + odp_cpumask_default_worker(&cpumask, arg->numthrds); >>> odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, >>> (void *)arg); >>> >>> diff --git a/test/performance/odp_atomic.c >> b/test/performance/odp_atomic.c >>> index eefce06..1402a0c 100644 >>> --- a/test/performance/odp_atomic.c >>> +++ b/test/performance/odp_atomic.c >>> @@ -284,7 +284,7 @@ int odp_test_thread_create(void *func_ptr(void >> *), pthrd_arg *arg) >>> odp_cpumask_t cpumask; >>> >>> /* Create and init additional threads */ >>> - odp_cpumask_def_worker(&cpumask, arg->numthrds); >>> + odp_cpumask_default_worker(&cpumask, arg->numthrds); >>> odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, >>> (void *)arg); >>> >>> diff --git a/test/performance/odp_l2fwd.c >> b/test/performance/odp_l2fwd.c >>> index 64fc1b2..5155599 100644 >>> --- a/test/performance/odp_l2fwd.c >>> +++ b/test/performance/odp_l2fwd.c >>> @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) >>> num_workers = gbl_args->appl.cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/test/performance/odp_pktio_perf.c >> b/test/performance/odp_pktio_perf.c >>> index 709becf..4437008 100644 >>> --- a/test/performance/odp_pktio_perf.c >>> +++ b/test/performance/odp_pktio_perf.c >>> @@ -544,8 +544,9 @@ static int setup_txrx_masks(odp_cpumask_t >> *thd_mask_tx, >>> int num_workers, num_tx_workers, num_rx_workers; >>> int i, cpu; >>> >>> - num_workers = odp_cpumask_def_worker(&cpumask, >>> - gbl_args->args.cpu_count); >>> + num_workers = >>> + odp_cpumask_default_worker(&cpumask, >>> + gbl_args->args.cpu_count); >>> if (num_workers < 2) { >>> LOG_ERR("Need at least two cores\n"); >>> return -1; >>> diff --git a/test/performance/odp_scheduling.c >> b/test/performance/odp_scheduling.c >>> index aa68634..73eeb72 100644 >>> --- a/test/performance/odp_scheduling.c >>> +++ b/test/performance/odp_scheduling.c >>> @@ -880,7 +880,7 @@ int main(int argc, char *argv[]) >>> num_workers = args.cpu_count; >>> >>> /* Get default worker cpumask */ >>> - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); >>> + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); >>> (void)odp_cpumask_to_str(&cpumask, cpumaskstr, >> sizeof(cpumaskstr)); >>> printf("num worker threads: %i\n", num_workers); >>> diff --git a/test/validation/common/odp_cunit_common.c >> b/test/validation/common/odp_cunit_common.c >>> index d995ad3..0f79199 100644 >>> --- a/test/validation/common/odp_cunit_common.c >>> +++ b/test/validation/common/odp_cunit_common.c >>> @@ -28,7 +28,7 @@ int odp_cunit_thread_create(void *func_ptr(void *), >> pthrd_arg *arg) >>> odp_cpumask_t cpumask; >>> >>> /* Create and init additional threads */ >>> - odp_cpumask_def_worker(&cpumask, arg->numthrds); >>> + odp_cpumask_default_worker(&cpumask, arg->numthrds); >>> >>> return odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, >>> (void *)arg); >>> diff --git a/test/validation/cpumask/cpumask.c >> b/test/validation/cpumask/cpumask.c >>> index 6d57028..d09744a 100644 >>> --- a/test/validation/cpumask/cpumask.c >>> +++ b/test/validation/cpumask/cpumask.c >>> @@ -20,7 +20,7 @@ void cpumask_test_odp_cpumask_def_control(void) >>> unsigned max_cpus = mask_capacity(); >>> odp_cpumask_t mask; >>> >>> - num = odp_cpumask_def_control(&mask, ALL_AVAILABLE); >>> + num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); >>> mask_count = odp_cpumask_count(&mask); >>> >>> CU_ASSERT(mask_count == num); >>> @@ -35,7 +35,7 @@ void cpumask_test_odp_cpumask_def_worker(void) >>> unsigned max_cpus = mask_capacity(); >>> odp_cpumask_t mask; >>> >>> - num = odp_cpumask_def_worker(&mask, ALL_AVAILABLE); >>> + num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); >>> mask_count = odp_cpumask_count(&mask); >>> >>> CU_ASSERT(mask_count == num); >>> @@ -59,11 +59,11 @@ void cpumask_test_odp_cpumask_def(void) >>> requested_cpus = available_cpus - 1; >>> else >>> requested_cpus = available_cpus; >>> - num_worker = odp_cpumask_def_worker(&mask, requested_cpus); >>> + num_worker = odp_cpumask_default_worker(&mask, requested_cpus); >>> mask_count = odp_cpumask_count(&mask); >>> CU_ASSERT(mask_count == num_worker); >>> >>> - num_control = odp_cpumask_def_control(&mask, 1); >>> + num_control = odp_cpumask_default_control(&mask, 1); >>> mask_count = odp_cpumask_count(&mask); >>> CU_ASSERT(mask_count == num_control); >>> >>> diff --git a/test/validation/scheduler/scheduler.c >> b/test/validation/scheduler/scheduler.c >>> index 1874889..d94de6b 100644 >>> --- a/test/validation/scheduler/scheduler.c >>> +++ b/test/validation/scheduler/scheduler.c >>> @@ -1017,7 +1017,7 @@ int scheduler_suite_init(void) >>> >>> memset(globals, 0, sizeof(test_globals_t)); >>> >>> - globals->num_workers = odp_cpumask_def_worker(&mask, 0); >>> + globals->num_workers = odp_cpumask_default_worker(&mask, 0); >>> if (globals->num_workers > MAX_WORKERS) >>> globals->num_workers = MAX_WORKERS; >>> >>> diff --git a/test/validation/synchronizers/synchronizers.c >> b/test/validation/synchronizers/synchronizers.c >>> index 0a31a40..06977f9 100644 >>> --- a/test/validation/synchronizers/synchronizers.c >>> +++ b/test/validation/synchronizers/synchronizers.c >>> @@ -1082,7 +1082,7 @@ int synchronizers_init(void) >>> global_mem->g_iterations = MAX_ITERATIONS; >>> global_mem->g_verbose = VERBOSE; >>> >>> - workers_count = odp_cpumask_def_worker(&mask, 0); >>> + workers_count = odp_cpumask_default_worker(&mask, 0); >>> >>> max_threads = (workers_count >= MAX_WORKERS) ? >>> MAX_WORKERS : workers_count; >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> https://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 3123936..2d90ae7 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -431,7 +431,7 @@ int main(int argc, char *argv[]) num_workers = args->cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index f7aed76..3bb6c4f 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) if (args->appl.cpu_count) num_workers = args->appl.cpu_count; - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); if (args->appl.mask) { odp_cpumask_from_str(&cpumask, args->appl.mask); num_workers = odp_cpumask_count(&cpumask); @@ -918,7 +918,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'c': appl_args->mask = optarg; odp_cpumask_from_str(&cpumask_args, args->appl.mask); - num_workers = odp_cpumask_def_worker(&cpumask, 0); + num_workers = odp_cpumask_default_worker(&cpumask, 0); odp_cpumask_and(&cpumask_and, &cpumask_args, &cpumask); if (odp_cpumask_count(&cpumask_and) < odp_cpumask_count(&cpumask_args)) { diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 96effe2..998e51d 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1296,7 +1296,7 @@ main(int argc, char *argv[]) num_workers = args->appl.cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index df53ea2..ce53ee3 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -386,7 +386,7 @@ int main(int argc, char *argv[]) num_workers = args->appl.cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 49630b0..ce9faf9 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) num_workers = gbls->args.cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c index d3a5943..cb9b328 100644 --- a/helper/test/odp_process.c +++ b/helper/test/odp_process.c @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) } /* discover how many processes this system can support */ - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); if (num_workers < NUMBER_WORKERS) { printf("System can only support %d processes and not the %d requested\n", num_workers, NUMBER_WORKERS); diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c index 1de30ab..592f856 100644 --- a/helper/test/odp_thread.c +++ b/helper/test/odp_thread.c @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) } /* discover how many threads this system can support */ - num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); + num_workers = odp_cpumask_default_worker(&cpu_mask, NUMBER_WORKERS); if (num_workers < NUMBER_WORKERS) { printf("System can only support %d threads and not the %d requested\n", num_workers, NUMBER_WORKERS); diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h index 2ad7fea..4835a6c 100644 --- a/include/odp/api/cpumask.h +++ b/include/odp/api/cpumask.h @@ -203,7 +203,7 @@ int odp_cpumask_next(const odp_cpumask_t *mask, int cpu); * @param num Number of worker threads, zero for all available CPUs * @return Actual number of CPUs used to create the mask */ -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num); /** * Default cpumask for control threads @@ -215,7 +215,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num); * @param num Number of control threads, zero for all available CPUs * @return Actual number of CPUs used to create the mask */ -int odp_cpumask_def_control(odp_cpumask_t *mask, int num); +int odp_cpumask_default_control(odp_cpumask_t *mask, int num); /** * @} diff --git a/platform/linux-generic/odp_cpumask_task.c b/platform/linux-generic/odp_cpumask_task.c index 665e82a..535891c 100644 --- a/platform/linux-generic/odp_cpumask_task.c +++ b/platform/linux-generic/odp_cpumask_task.c @@ -13,7 +13,7 @@ #include <odp/cpumask.h> #include <odp_debug_internal.h> -int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) +int odp_cpumask_default_worker(odp_cpumask_t *mask, int num) { int ret, cpu, i; cpu_set_t cpuset; @@ -43,7 +43,7 @@ int odp_cpumask_def_worker(odp_cpumask_t *mask, int num) return cpu; } -int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED) +int odp_cpumask_default_control(odp_cpumask_t *mask, int num ODP_UNUSED) { odp_cpumask_zero(mask); /* By default all control threads on CPU 0 */ diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index 0dbefa5..681d915 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -74,7 +74,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) odp_cpumask_t cpumask; /* Create and init additional threads */ - odp_cpumask_def_worker(&cpumask, arg->numthrds); + odp_cpumask_default_worker(&cpumask, arg->numthrds); odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, (void *)arg); diff --git a/test/performance/odp_atomic.c b/test/performance/odp_atomic.c index eefce06..1402a0c 100644 --- a/test/performance/odp_atomic.c +++ b/test/performance/odp_atomic.c @@ -284,7 +284,7 @@ int odp_test_thread_create(void *func_ptr(void *), pthrd_arg *arg) odp_cpumask_t cpumask; /* Create and init additional threads */ - odp_cpumask_def_worker(&cpumask, arg->numthrds); + odp_cpumask_default_worker(&cpumask, arg->numthrds); odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, (void *)arg); diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 64fc1b2..5155599 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) num_workers = gbl_args->appl.cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 709becf..4437008 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -544,8 +544,9 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx, int num_workers, num_tx_workers, num_rx_workers; int i, cpu; - num_workers = odp_cpumask_def_worker(&cpumask, - gbl_args->args.cpu_count); + num_workers = + odp_cpumask_default_worker(&cpumask, + gbl_args->args.cpu_count); if (num_workers < 2) { LOG_ERR("Need at least two cores\n"); return -1; diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index aa68634..73eeb72 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -880,7 +880,7 @@ int main(int argc, char *argv[]) num_workers = args.cpu_count; /* Get default worker cpumask */ - num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c index d995ad3..0f79199 100644 --- a/test/validation/common/odp_cunit_common.c +++ b/test/validation/common/odp_cunit_common.c @@ -28,7 +28,7 @@ int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg) odp_cpumask_t cpumask; /* Create and init additional threads */ - odp_cpumask_def_worker(&cpumask, arg->numthrds); + odp_cpumask_default_worker(&cpumask, arg->numthrds); return odph_linux_pthread_create(thread_tbl, &cpumask, func_ptr, (void *)arg); diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c index 6d57028..d09744a 100644 --- a/test/validation/cpumask/cpumask.c +++ b/test/validation/cpumask/cpumask.c @@ -20,7 +20,7 @@ void cpumask_test_odp_cpumask_def_control(void) unsigned max_cpus = mask_capacity(); odp_cpumask_t mask; - num = odp_cpumask_def_control(&mask, ALL_AVAILABLE); + num = odp_cpumask_default_control(&mask, ALL_AVAILABLE); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num); @@ -35,7 +35,7 @@ void cpumask_test_odp_cpumask_def_worker(void) unsigned max_cpus = mask_capacity(); odp_cpumask_t mask; - num = odp_cpumask_def_worker(&mask, ALL_AVAILABLE); + num = odp_cpumask_default_worker(&mask, ALL_AVAILABLE); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num); @@ -59,11 +59,11 @@ void cpumask_test_odp_cpumask_def(void) requested_cpus = available_cpus - 1; else requested_cpus = available_cpus; - num_worker = odp_cpumask_def_worker(&mask, requested_cpus); + num_worker = odp_cpumask_default_worker(&mask, requested_cpus); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num_worker); - num_control = odp_cpumask_def_control(&mask, 1); + num_control = odp_cpumask_default_control(&mask, 1); mask_count = odp_cpumask_count(&mask); CU_ASSERT(mask_count == num_control); diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 1874889..d94de6b 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -1017,7 +1017,7 @@ int scheduler_suite_init(void) memset(globals, 0, sizeof(test_globals_t)); - globals->num_workers = odp_cpumask_def_worker(&mask, 0); + globals->num_workers = odp_cpumask_default_worker(&mask, 0); if (globals->num_workers > MAX_WORKERS) globals->num_workers = MAX_WORKERS; diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 0a31a40..06977f9 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -1082,7 +1082,7 @@ int synchronizers_init(void) global_mem->g_iterations = MAX_ITERATIONS; global_mem->g_verbose = VERBOSE; - workers_count = odp_cpumask_def_worker(&mask, 0); + workers_count = odp_cpumask_default_worker(&mask, 0); max_threads = (workers_count >= MAX_WORKERS) ? MAX_WORKERS : workers_count;
Use full default word in api to make function name more clear. https://bugs.linaro.org/show_bug.cgi?id=1745 Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- v2: - merge 1 (api update) and 2 (code fix) patches from v1. - remove patches 3 and 4 to not support NULL for mask. example/classifier/odp_classifier.c | 2 +- example/generator/odp_generator.c | 4 ++-- example/ipsec/odp_ipsec.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 2 +- helper/test/odp_process.c | 2 +- helper/test/odp_thread.c | 2 +- include/odp/api/cpumask.h | 4 ++-- platform/linux-generic/odp_cpumask_task.c | 4 ++-- test/api_test/odp_common.c | 2 +- test/performance/odp_atomic.c | 2 +- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_pktio_perf.c | 5 +++-- test/performance/odp_scheduling.c | 2 +- test/validation/common/odp_cunit_common.c | 2 +- test/validation/cpumask/cpumask.c | 8 ++++---- test/validation/scheduler/scheduler.c | 2 +- test/validation/synchronizers/synchronizers.c | 2 +- 18 files changed, 26 insertions(+), 25 deletions(-)