From patchwork Wed May 11 16:41:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67571 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp300044qge; Wed, 11 May 2016 09:00:09 -0700 (PDT) X-Received: by 10.55.90.130 with SMTP id o124mr4676438qkb.178.1462982409391; Wed, 11 May 2016 09:00:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y83si5641249qka.43.2016.05.11.09.00.09; Wed, 11 May 2016 09:00:09 -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 02A0C6166D; Wed, 11 May 2016 16:00:09 +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 9070B61655; Wed, 11 May 2016 15:46:38 +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 4486C616D6; Wed, 11 May 2016 15:46:32 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id E40D461671 for ; Wed, 11 May 2016 15:44:21 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id y84so54205386lfc.0 for ; Wed, 11 May 2016 08:44:21 -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=MfGXPyzoPP+lfxR+WWJdWfwZu0QNenT+0Cu8xKLBtTbOjvN3oWSOxdlNrHerOBFLCM aHXf+6LkzBZ2KhdXIu48GdjaNt2zMOlTEBbd+bezHDnww6yxtM/3iHvLgoLH9TcBldG6 87cKtMs+EfaG0HYSsmWsRp9XjcXmpGdoBavqPYzxxIxCBhIcVY4lvZuqRJtzpCFheFjA s7vm5quJxXTdONtybNawsMRaYro4bmwUH9FoSuLbTh/nZMyoDW1wrJlzffnFWVXQhTQj 4IdT2DiANMNTfw1SIBr52IRrmGZSFtmVDKpsrqnE9t3Ygz0ZfyFJ+P+/9rVaTCSrMz0Q oXoQ== X-Gm-Message-State: AOPr4FXkP2anCCG5Ybi/PYrRgpKksrRyhRoKxXjxgP7kgdO/bNyNZQyED6Xj4sEpGpwIKmNb1ZI= X-Received: by 10.112.181.72 with SMTP id du8mr1878479lbc.137.1462981460899; Wed, 11 May 2016 08:44:20 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id n37sm1421164lfg.46.2016.05.11.08.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 08:44:20 -0700 (PDT) From: Christophe Milard To: brian.brooks@linaro.org, mike.holmes@linaro.org, lng-odp@lists.linaro.org Date: Wed, 11 May 2016 18:41:58 +0200 Message-Id: <1462984942-53326-15-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462984942-53326-1-git-send-email-christophe.milard@linaro.org> References: <1462984942-53326-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv6 14/38] 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);