From patchwork Fri Dec 19 20:34:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42497 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1726B26C6B for ; Fri, 19 Dec 2014 20:35:21 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf1180790lbd.10 for ; Fri, 19 Dec 2014 12:35:20 -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:in-reply-to :references: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=nomMsCfhEc6bVUqx2oAexBhZ6SmXcslqUhqlZeTzXMg=; b=Oes+Jgr2iG6ydTxj1Q0KMhlTMCz6gsJtqWPUsxOvdbP9ZQ8R8BwJNOgKO2WMy9iq0e ECRqAkIg07wsllU7Vn3AY0jb5mES0seVdJW0GlDA7j0WU5GVejLwEQbSSMDvf9zYZIkY q+1bqvvE1186P6IFy3ZvBC7TfssWBKOhbbByw+sanDvdkDaqwPUrBrUgKHB85bAE+k/+ 7wIqGsD5zK/mMmh7FzVcTM49cjG3hKpR/0PMRk7LeD+s1UA2yRBWxHSwE4A4n3As8NcX ifG7+vWKq3VpScn3XcOdJMsKvcYzNPvUBd/ipIoF9EYzGfI/lZRi3BWQ1RHlE9/n36d7 v2gw== X-Gm-Message-State: ALoCoQm/qbKAS+zbd+J1Lhr8Ro+iL2JYYGp+CLKXA8gzdxav/GCE8r7/7Tn6IUA/GdFVAlzjEn3+ X-Received: by 10.152.8.67 with SMTP id p3mr629195laa.4.1419021319720; Fri, 19 Dec 2014 12:35:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.1 with SMTP id ku1ls101268lac.80.gmail; Fri, 19 Dec 2014 12:35:19 -0800 (PST) X-Received: by 10.112.55.97 with SMTP id r1mr9460713lbp.49.1419021319500; Fri, 19 Dec 2014 12:35:19 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id b9si11018378lah.61.2014.12.19.12.35.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Dec 2014 12:35:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so1451318lbg.15 for ; Fri, 19 Dec 2014 12:35:19 -0800 (PST) X-Received: by 10.112.135.229 with SMTP id pv5mr9713205lbb.52.1419021319064; Fri, 19 Dec 2014 12:35:19 -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.142.69 with SMTP id ru5csp386258lbb; Fri, 19 Dec 2014 12:35:18 -0800 (PST) X-Received: by 10.140.96.195 with SMTP id k61mr15963962qge.104.1419021317331; Fri, 19 Dec 2014 12:35:17 -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 j61si12884139qgj.88.2014.12.19.12.35.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Dec 2014 12:35:17 -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 1Y24GY-00088P-Hl; Fri, 19 Dec 2014 20:35:14 +0000 Received: from mail-qa0-f46.google.com ([209.85.216.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y24GL-00087F-Td for lng-odp@lists.linaro.org; Fri, 19 Dec 2014 20:35:01 +0000 Received: by mail-qa0-f46.google.com with SMTP id w8so1121873qac.5 for ; Fri, 19 Dec 2014 12:34:56 -0800 (PST) X-Received: by 10.140.105.200 with SMTP id c66mr15937776qgf.40.1419021296733; Fri, 19 Dec 2014 12:34:56 -0800 (PST) Received: from localhost.localdomain ([98.221.136.245]) by mx.google.com with ESMTPSA id f65sm10334098qgf.41.2014.12.19.12.34.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Dec 2014 12:34:56 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 19 Dec 2014 15:34:46 -0500 Message-Id: <1419021288-29268-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419021288-29268-1-git-send-email-mike.holmes@linaro.org> References: <1419021288-29268-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 1/3] example: odp_example: remove use of odp_schdule_one 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: mike.holmes@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.217.170 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 The api odp_schedule_one has been removed, the examples should not attempt to call it. Signed-off-by: Mike Holmes Reviewed-by: Bala Manoharan --- example/odp_example/odp_example.c | 140 -------------------------------------- 1 file changed, 140 deletions(-) diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index 8373f12..8f01292 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -310,124 +310,6 @@ static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool) return 0; } -/** - * @internal Test scheduling of a single queue - with odp_schedule_one() - * - * Enqueue a buffer to the shared queue. Schedule and enqueue the received - * buffer back into the queue. - * - * @param str Test case name string - * @param thr Thread - * @param msg_pool Buffer pool - * @param prio Priority - * @param barrier Barrier - * - * @return 0 if successful - */ -static int test_schedule_one_single(const char *str, int thr, - odp_buffer_pool_t msg_pool, - int prio, odp_barrier_t *barrier) -{ - odp_buffer_t buf; - odp_queue_t queue; - uint64_t t1, t2, cycles, ns; - uint32_t i; - uint32_t tot = 0; - - if (create_queue(thr, msg_pool, prio)) - return -1; - - t1 = odp_time_cycles(); - - for (i = 0; i < QUEUE_ROUNDS; i++) { - buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); - - if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); - return -1; - } - } - - if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC) - odp_schedule_release_atomic(); - - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); - tot = i; - - odp_barrier_wait(barrier); - clear_sched_queues(); - - cycles = cycles/tot; - ns = ns/tot; - - printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, str, cycles, ns); - - return 0; -} - -/** - * @internal Test scheduling of multiple queues - with odp_schedule_one() - * - * Enqueue a buffer to each queue. Schedule and enqueue the received - * buffer back into the queue it came from. - * - * @param str Test case name string - * @param thr Thread - * @param msg_pool Buffer pool - * @param prio Priority - * @param barrier Barrier - * - * @return 0 if successful - */ -static int test_schedule_one_many(const char *str, int thr, - odp_buffer_pool_t msg_pool, - int prio, odp_barrier_t *barrier) -{ - odp_buffer_t buf; - odp_queue_t queue; - uint64_t t1 = 0; - uint64_t t2 = 0; - uint64_t cycles, ns; - uint32_t i; - uint32_t tot = 0; - - if (create_queues(thr, msg_pool, prio)) - return -1; - - /* Start sched-enq loop */ - t1 = odp_time_cycles(); - - for (i = 0; i < QUEUE_ROUNDS; i++) { - buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); - - if (odp_queue_enq(queue, buf)) { - EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); - return -1; - } - } - - if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC) - odp_schedule_release_atomic(); - - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); - tot = i; - - odp_barrier_wait(barrier); - clear_sched_queues(); - - cycles = cycles/tot; - ns = ns/tot; - - printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, str, cycles, ns); - - return 0; -} /** * @internal Test scheduling of a single queue - with odp_schedule() @@ -763,22 +645,12 @@ static void *run_thread(void *arg) 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_wait(barrier); - if (test_schedule_single("sched_____s_lo", thr, msg_pool, ODP_SCHED_PRIO_LOWEST, barrier)) return NULL; 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_wait(barrier); if (test_schedule_many("sched_____m_lo", thr, msg_pool, @@ -795,24 +667,12 @@ static void *run_thread(void *arg) 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_wait(barrier); - if (test_schedule_single("sched_____s_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL; 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_wait(barrier); - if (test_schedule_many("sched_____m_hi", thr, msg_pool, ODP_SCHED_PRIO_HIGHEST, barrier)) return NULL;