From patchwork Tue May 17 13:04:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67957 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2075132qge; Tue, 17 May 2016 06:27:42 -0700 (PDT) X-Received: by 10.140.142.136 with SMTP id 130mr1472369qho.64.1463491662647; Tue, 17 May 2016 06:27:42 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n82si2233563qke.59.2016.05.17.06.27.42; Tue, 17 May 2016 06:27:42 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3BFC161786; Tue, 17 May 2016 13:27:42 +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 EFCBF61789; Tue, 17 May 2016 13:15:17 +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 E784E61789; Tue, 17 May 2016 13:14:59 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id DB3816178C for ; Tue, 17 May 2016 13:05:20 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id j8so6495317lfd.2 for ; Tue, 17 May 2016 06:05:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zD3y3QW5eRk63DTKPMDvZ+08mgPglWqUseo56Ih9Pp4=; b=Z6gNvGTacaRSEONiVVh7GFen3Ha3V+fOHTR0mNJVOzDgBQy7VKvSbtYlrUftFlo7XT i7zYxMy8zJoVS3WwJ6jIZXlRlga0mN0SH9kY1UnYqgt+zMSlUBYmuHxADEXATlswUsww BGkEyPu9Y+ftKQeMlx9jp11eBMvUFaiJFWuG30Rr+0oiqghcCgTtHR/GhDbomA7GQxku iohkoxirScYzvoHaiKYilAScu5FJ0FdGXm2fKwNbIIT3CAsCmzVQvKuFZvhCwX7HAxv9 0YgpaU6EJ94zlCbzRED6Cjb7/ja8N3OvuCCi2/xz6ItiM5iy+IFFdTLGLtZXkNLvAerl dmiA== X-Gm-Message-State: AOPr4FUprrKOEJoPcowBG7h/xfunFSRRQ7dP3WNdtXqF+CLw4bEXCswU/YSkK4lU6nz8CanVoPI= X-Received: by 10.25.137.130 with SMTP id l124mr459108lfd.122.1463490319828; Tue, 17 May 2016 06:05:19 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id q1sm506536lbo.4.2016.05.17.06.05.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 May 2016 06:05:19 -0700 (PDT) From: Christophe Milard To: lng-odp@lists.linaro.org, brian.brooks@linaro.org, mike.holmes@linaro.org Date: Tue, 17 May 2016 15:04:18 +0200 Message-Id: <1463490282-23277-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> References: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv7 11/35] performance: odp_pktio_perf: using agnostic function for ODP threads X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" odp_pktio_perf is changed to use the implementation agnostic ODP thread create and join functions, from helpers. odp_pktio_perf is no longer aware on how the odpthread is implemented any longer. Signed-off-by: Christophe Milard --- test/performance/odp_pktio_perf.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 57635d3..e1efc4a 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -303,7 +303,7 @@ static int send_packets(odp_pktout_queue_t pktout, * Main packet transmit routine. Transmit packets at a fixed rate for * specified length of time. */ -static void *run_thread_tx(void *arg) +static int run_thread_tx(void *arg) { test_globals_t *globals; int thr_id; @@ -381,7 +381,7 @@ static void *run_thread_tx(void *arg) odp_time_to_ns(stats->s.idle_ticks) / (uint64_t)ODP_TIME_MSEC_IN_NS); - return NULL; + return 0; } static int receive_packets(odp_queue_t queue, @@ -411,7 +411,7 @@ static int receive_packets(odp_queue_t queue, return n_ev; } -static void *run_thread_rx(void *arg) +static int run_thread_rx(void *arg) { test_globals_t *globals; int thr_id, batch_len; @@ -456,7 +456,7 @@ static void *run_thread_rx(void *arg) break; } - return NULL; + return 0; } /* @@ -601,11 +601,11 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx, odp_cpumask_t *thd_mask_rx, test_status_t *status) { - odph_linux_pthread_t thd_tbl[MAX_WORKERS]; + odph_odpthread_t thd_tbl[MAX_WORKERS]; thread_args_t args_tx, args_rx; uint64_t expected_tx_cnt; int num_tx_workers, num_rx_workers; - odph_linux_thr_params_t thr_params; + odph_odpthread_params_t thr_params; memset(&thr_params, 0, sizeof(thr_params)); thr_params.thr_type = ODP_THREAD_WORKER; @@ -623,7 +623,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx, thr_params.start = run_thread_rx; thr_params.arg = &args_rx; args_rx.batch_len = gbl_args->args.rx_batch_len; - odph_linux_pthread_create(&thd_tbl[0], thd_mask_rx, &thr_params); + odph_odpthreads_create(&thd_tbl[0], thd_mask_rx, &thr_params); odp_barrier_wait(&gbl_args->rx_barrier); num_rx_workers = odp_cpumask_count(thd_mask_rx); @@ -634,13 +634,12 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx, args_tx.pps = status->pps_curr / num_tx_workers; args_tx.duration = gbl_args->args.duration; args_tx.batch_len = gbl_args->args.tx_batch_len; - odph_linux_pthread_create(&thd_tbl[num_rx_workers], thd_mask_tx, - &thr_params); + odph_odpthreads_create(&thd_tbl[num_rx_workers], thd_mask_tx, + &thr_params); odp_barrier_wait(&gbl_args->tx_barrier); /* wait for transmitter threads to terminate */ - odph_linux_pthread_join(&thd_tbl[num_rx_workers], - num_tx_workers); + odph_odpthreads_join(&thd_tbl[num_rx_workers]); /* delay to allow transmitted packets to reach the receivers */ odp_time_wait_ns(SHUTDOWN_DELAY_NS); @@ -649,7 +648,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx, odp_atomic_store_u32(&shutdown, 1); /* wait for receivers */ - odph_linux_pthread_join(&thd_tbl[0], num_rx_workers); + odph_odpthreads_join(&thd_tbl[0]); if (!status->warmup) return process_results(expected_tx_cnt, status);