From patchwork Fri May 20 16:30:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68261 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3853840qge; Fri, 20 May 2016 08:45:58 -0700 (PDT) X-Received: by 10.140.172.138 with SMTP id s132mr4174122qhs.69.1463759158781; Fri, 20 May 2016 08:45:58 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e189si18645055qkd.257.2016.05.20.08.45.58; Fri, 20 May 2016 08:45:58 -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 61BFC61588; Fri, 20 May 2016 15:45:58 +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 5824D6184C; Fri, 20 May 2016 15:34: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 F37416184D; Fri, 20 May 2016 15:34:11 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by lists.linaro.org (Postfix) with ESMTPS id BD12A61701 for ; Fri, 20 May 2016 15:32:12 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id e131so2573694lfb.0 for ; Fri, 20 May 2016 08:32:12 -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=CPMgnNUNjO22+A5emoyF6mCtBHd4fpYa0gaH2oEyP3vWKpU+61eN+XNLkCwMpfmkJY Up2SajtkUCxXwGJ5MR2+h+fSBWFsX0lxxRgNQpAK0uK2ZuP1PyGDv0YlaV7JZV/QlIGj o82RR/yp6WZF0beBqb7X1EbPJCYSVYENbgPSonjBgJ4J2SupZ7PiE5WrFaq4c22tLeBk lAme7nUz/H4+yRUzW77x5X8nJs9fxWp4wgc//ZEvyKNK4z3P2CDOaauwtQKssOhZnA/R VQ6sn+3VrFenEUZwgJqDqZVGpS+nXZEV+EAFeQFi7zeJPyfkeYme6AMhp+QqAzVsfNGu 8U8g== X-Gm-Message-State: AOPr4FXU84aFDPrkvL2uHYxaqWkaY01oiPrjgDCWFo+2NirsMtPNScRDaV1g0wZx+HIQw33jNtI= X-Received: by 10.25.208.76 with SMTP id h73mr1408466lfg.74.1463758331265; Fri, 20 May 2016 08:32:11 -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 tg1sm3348847lbb.7.2016.05.20.08.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 08:32:10 -0700 (PDT) From: Christophe Milard To: maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Fri, 20 May 2016 18:30:27 +0200 Message-Id: <1463761851-37121-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> References: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv9 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);