From patchwork Mon Nov 17 23:19:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 40979 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 402252450C for ; Mon, 17 Nov 2014 23:19:33 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf3704659lam.2 for ; Mon, 17 Nov 2014 15:19:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=bd3cww6piCgeVJd3BSR26jcoKePFThBCQtmyA6hI3xg=; b=lOR6epnZuvQvrdRX/gsgSgVucnnpy/R8LtmuwyU3oCCss0I0WWPMkWw9rFDalTQEdH jrFjLctqCtOlYg25hjVaIoUp94mIOntng7aBEDaJPGvUKgsMedy5quHqWe3/qk5JCrNh 8+ZIQO9TrBb/Ecm5GieVDHKtoWigiTncyhqQqQsTaLoG/24U0mi7NeNMB+YtYKdfmp/z sL7hD9Up6fXb78QL3sCROpk9bnWI6MAvSJySAPimbE9QfuPC3URgWdnKsVs1eZ8fb1gb JSrGVGLScbgW1cBod55aDb5YlgvgZ+m6+kCI8aka4/OIa7oFLDCIH7PoW+eIt0rt+CFf 53BQ== X-Gm-Message-State: ALoCoQl3YbW2Ir3Ad5RAFOd7bzYSGPxz4tzQRSUfN69741LvYwwPyMjQu9Zlz35H69nr5mPbqLJU X-Received: by 10.194.71.19 with SMTP id q19mr108688wju.5.1416266372257; Mon, 17 Nov 2014 15:19:32 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.12 with SMTP id s12ls530982lal.26.gmail; Mon, 17 Nov 2014 15:19:32 -0800 (PST) X-Received: by 10.152.21.9 with SMTP id r9mr14171073lae.76.1416266372095; Mon, 17 Nov 2014 15:19:32 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id jp15si14195315lab.130.2014.11.17.15.19.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 15:19:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pv20so434917lab.37 for ; Mon, 17 Nov 2014 15:19:32 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr14070477lbb.80.1416266371976; Mon, 17 Nov 2014 15:19:31 -0800 (PST) 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.184.201 with SMTP id ew9csp1247059lbc; Mon, 17 Nov 2014 15:19:31 -0800 (PST) X-Received: by 10.229.248.132 with SMTP id mg4mr55931qcb.29.1416266370161; Mon, 17 Nov 2014 15:19:30 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id v9si60726623qat.45.2014.11.17.15.19.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Nov 2014 15:19:29 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XqVZt-0000lS-J2; Mon, 17 Nov 2014 23:19:25 +0000 Received: from mail-ob0-f181.google.com ([209.85.214.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XqVZm-0000kz-Q1 for lng-odp@lists.linaro.org; Mon, 17 Nov 2014 23:19:18 +0000 Received: by mail-ob0-f181.google.com with SMTP id gq1so4098874obb.40 for ; Mon, 17 Nov 2014 15:19:13 -0800 (PST) X-Received: by 10.202.214.80 with SMTP id n77mr16025689oig.9.1416266353461; Mon, 17 Nov 2014 15:19:13 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id e5sm7033842oic.16.2014.11.17.15.19.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 15:19:12 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 17 Nov 2014 17:19:02 -0600 Message-Id: <1416266343-7601-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] Update examples for odp_barrier.h API changes for ODP v1.0 X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@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.50 as permitted sender) smtp.mail=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 This patch updates example programs to reflect API name changes in odp_barrier.h for ODP v1.0 Signed-off-by: Bill Fischofer --- example/ipsec/odp_ipsec.c | 4 ++-- example/odp_example/odp_example.c | 46 +++++++++++++++++++-------------------- example/timer/odp_timer_test.c | 4 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 908bd95..55af90b 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1043,7 +1043,7 @@ void *pktio_thread(void *arg ODP_UNUSED) printf("Pktio thread [%02i] starts\n", thr); - odp_barrier_sync(&sync_barrier); + odp_barrier_wait(&sync_barrier); /* Loop packets */ for (;;) { @@ -1222,7 +1222,7 @@ main(int argc, char *argv[]) printf("Num worker threads: %i\n", num_workers); /* Create a barrier to synchronize thread startup */ - odp_barrier_init_count(&sync_barrier, num_workers); + odp_barrier_init(&sync_barrier, num_workers); /* * By default core #0 runs Linux kernel background tasks. diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index d0ec977..1ebccdb 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -353,7 +353,7 @@ static int test_schedule_one_single(const char *str, int thr, ns = odp_time_cycles_to_ns(cycles); tot = i; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -414,7 +414,7 @@ static int test_schedule_one_many(const char *str, int thr, ns = odp_time_cycles_to_ns(cycles); tot = i; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -489,7 +489,7 @@ static int test_schedule_single(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -568,7 +568,7 @@ static int test_schedule_many(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); cycles = cycles/tot; @@ -675,7 +675,7 @@ static int test_schedule_multi(const char *str, int thr, cycles = odp_time_diff_cycles(t1, t2); ns = odp_time_cycles_to_ns(cycles); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); clear_sched_queues(); if (tot) { @@ -724,10 +724,10 @@ static void *run_thread(void *arg) /* * Test barriers back-to-back */ - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); + odp_barrier_wait(barrier); /* * Find the buffer pool @@ -739,48 +739,48 @@ static void *run_thread(void *arg) return NULL; } - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_alloc_single(thr, msg_pool)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_alloc_multi(thr, msg_pool)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_poll_queue(thr, msg_pool)) return NULL; /* Low prio */ - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_single("sched_one_s_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_single("sched_____s_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_many("sched_one_m_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_many("sched_____m_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_multi("sched_multi_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) @@ -788,31 +788,31 @@ static void *run_thread(void *arg) /* High prio */ - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_single("sched_one_s_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_single("sched_____s_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_one_many("sched_one_m_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_many("sched_____m_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; - odp_barrier_sync(barrier); + odp_barrier_wait(barrier); if (test_schedule_multi("sched_multi_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) @@ -1105,7 +1105,7 @@ int main(int argc, char *argv[]) odp_shm_print_all(); /* Barrier to sync test case execution */ - odp_barrier_init_count(&globals->barrier, num_workers); + odp_barrier_init(&globals->barrier, num_workers); if (args.proc_mode) { int ret; diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 78b2ae2..f959a25 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -135,7 +135,7 @@ static void *run_thread(void *ptr) return NULL; } - odp_barrier_sync(&test_barrier); + odp_barrier_wait(&test_barrier); test_abs_timeouts(thr, args); @@ -372,7 +372,7 @@ int main(int argc, char *argv[]) printf("\n"); /* Barrier to sync test case execution */ - odp_barrier_init_count(&test_barrier, num_workers); + odp_barrier_init(&test_barrier, num_workers); /* Create and launch worker threads */ odph_linux_pthread_create(thread_tbl, num_workers, first_core,