From patchwork Fri Dec 12 18:35:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42196 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F0B926C77 for ; Fri, 12 Dec 2014 18:35:40 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf1562744wib.6 for ; Fri, 12 Dec 2014 10:35:39 -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=3FWe1B/YTP9dxcRgAgV6IN7JBesA/QufLOm9nu8CKDA=; b=K70oaGuxl5qx/LN4mvvSHX5kNIFdX0Kync/QYz0Aaryu5rmodWZjkmNd6PE8RLvQOd ODKoNQwNRdOQMpYWrZMLKYOYsJLhxMZuY3c/hgk0fzjr/biLy7pZk+eu1VTXH8fUuvtS UVcgdyS25GaSlEv/u0kxwvsychjwHFYp7xHzr4mNevbLJbtqsNwHhVxxdCFfOQlMGJFb wNQ3qAszB6fTVWcvpuGDRY2NvTq6vH3j5D7Do0iCZrRR4gNC/yNEcYnpyTfCn6wmpVKS 9LHJE/w2dOg2CaZhoKXS+L95OL/ah1N5HsbfoNaFJJiZVaXc9cU6AHIP6WOr/cCSpeF7 fDIg== X-Gm-Message-State: ALoCoQlKeJF+Px4ZEY2a5cQ7Pb1mMAVde2VpAgQG5zczfI5t6yDNTPF+y7EcYv+JITzzECDgLSdh X-Received: by 10.194.92.34 with SMTP id cj2mr585901wjb.5.1418409339705; Fri, 12 Dec 2014 10:35:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls441345laf.104.gmail; Fri, 12 Dec 2014 10:35:39 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr16658326lbc.23.1418409339538; Fri, 12 Dec 2014 10:35:39 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id kl8si2187754lac.120.2014.12.12.10.35.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 10:35:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so6554403lab.38 for ; Fri, 12 Dec 2014 10:35:39 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr16932658laz.71.1418409339058; Fri, 12 Dec 2014 10:35:39 -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 ru5csp61147lbb; Fri, 12 Dec 2014 10:35:36 -0800 (PST) X-Received: by 10.140.85.203 with SMTP id n69mr31833304qgd.78.1418409335743; Fri, 12 Dec 2014 10:35:35 -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 h3si2300358qan.113.2014.12.12.10.35.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Dec 2014 10:35:35 -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 1XzV3s-0000Lu-Mi; Fri, 12 Dec 2014 18:35:32 +0000 Received: from mail-qc0-f175.google.com ([209.85.216.175]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzV3d-0000LI-7I for lng-odp@lists.linaro.org; Fri, 12 Dec 2014 18:35:17 +0000 Received: by mail-qc0-f175.google.com with SMTP id b13so6488233qcw.20 for ; Fri, 12 Dec 2014 10:35:12 -0800 (PST) X-Received: by 10.224.160.212 with SMTP id o20mr33943435qax.57.1418409311257; Fri, 12 Dec 2014 10:35:11 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id b1sm2091690qac.24.2014.12.12.10.35.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Dec 2014 10:35:10 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 12 Dec 2014 13:35:02 -0500 Message-Id: <1418409304-1924-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418409304-1924-1-git-send-email-mike.holmes@linaro.org> References: <1418409304-1924-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.215.51 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 --- 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 96a2912..b28bb00 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;