From patchwork Mon Sep 14 13:35:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 53560 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 5213E22B17 for ; Mon, 14 Sep 2015 13:38:23 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf41522984wic.2 for ; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=h0fVSx2XW8Ek/XId8Cn6PzAvDlB3i43v/N1VKp95GWE=; b=emc+m/R81mqe/dRAmKc5cLeSf2ymT4+CogHyEICj7a3jIRmAGCMdLh4m1WZC3YhqZu 2zyOjirfe8ECy/u3wNismKVp/Bp/n+7jJ7GXYVE5uYA6VbC+LenlvLQh5BXGLNQJ8KhD jXQjid0yRiYibKRJ3R47e5ANYLgwtBnz0Q7NtPE1PgE2d5locOC1yzj2t4B2KF6Yu6Hu DHzOXbXv4L8wUzhnsq6zTm97tE15TIXwu/RY1rsg7GTF1oiMi287Hdr5YT+nBEpSxmU0 K/Yq8/ITQWwNesevSVcceLbGbZDrDNpzPq7C95Q00YzMHKfa9zzuX9AdMIT3U9PS3E+E Nlvg== X-Gm-Message-State: ALoCoQlMExuUk9uobaohTGnVpC/vLUhYDOyPRpphfgwjOx8x/dcg++srn75C95j3Wt/DdAUUX9iC X-Received: by 10.112.199.5 with SMTP id jg5mr3056782lbc.14.1442237902503; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.170 with SMTP id c10ls581573lah.14.gmail; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) X-Received: by 10.152.21.229 with SMTP id y5mr13970279lae.44.1442237902338; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id kx4si7538628lbc.97.2015.09.14.06.38.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 06:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lagj9 with SMTP id j9so88035537lag.2 for ; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) X-Received: by 10.112.129.202 with SMTP id ny10mr13929108lbb.112.1442237902150; Mon, 14 Sep 2015 06:38:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1206044lbq; Mon, 14 Sep 2015 06:38:19 -0700 (PDT) X-Received: by 10.55.209.210 with SMTP id o79mr21609593qkl.43.1442237899613; Mon, 14 Sep 2015 06:38:19 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t74si12019471qgd.79.2015.09.14.06.38.17; Mon, 14 Sep 2015 06:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 6171361D3A; Mon, 14 Sep 2015 13:38:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 65EA061CCA; Mon, 14 Sep 2015 13:38:08 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3796E61CCA; Mon, 14 Sep 2015 13:38:03 +0000 (UTC) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id C589D61CCA for ; Mon, 14 Sep 2015 13:35:41 +0000 (UTC) Received: by lahg1 with SMTP id g1so57033111lah.1 for ; Mon, 14 Sep 2015 06:35:40 -0700 (PDT) X-Received: by 10.112.129.72 with SMTP id nu8mr13991105lbb.81.1442237740615; Mon, 14 Sep 2015 06:35:40 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id g3sm2395694lbd.16.2015.09.14.06.35.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 06:35:39 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 14 Sep 2015 16:35:30 +0300 Message-Id: <1442237730-5251-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2] api: rename odp_cpumask_def to _default X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Ivan Khoronzhuk Reviewed-by: Petri Savolainen --- 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 #include -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;