From patchwork Wed May 11 16:42:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67593 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp307525qge; Wed, 11 May 2016 09:13:30 -0700 (PDT) X-Received: by 10.140.252.10 with SMTP id x10mr4625066qhc.81.1462983210483; Wed, 11 May 2016 09:13:30 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e125si5630032qkb.277.2016.05.11.09.13.30; Wed, 11 May 2016 09:13:30 -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 16AB96169F; Wed, 11 May 2016 16:13:30 +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 81B2661722; Wed, 11 May 2016 15:48:55 +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 0071D61678; Wed, 11 May 2016 15:48:42 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id CFE046169E for ; Wed, 11 May 2016 15:44:43 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id j8so53756189lfd.2 for ; Wed, 11 May 2016 08:44:43 -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=Neq2t6Wjc86CxzQ2Sm1ye5Izdu4TzPr351IUJxDpcf4=; b=l7qky91nprcVs3JJFpWK8iKFo1V7d1nwdU8YJu21laPfvKoj6Ue3w4RcIZHJfvv/Rk 8YRTg27GQoENQX0osRZCAuemKIwINZHBPpCKychhnsc8mFJTVBV7Vb3K2BYsjz8/+JSa xVpQmm5Onu+rtZxgzZ3+1eXobG7e2Dj+q+oaxREZvIR9BkdGpHqOBMWgz5CzX29bMRCh X+7n9+EgDnBxWsBPu4mOzUoqaFBbDFuZRHa/TDO0ElMA7zebHR5HNqyvaHF9JUnCFceW erNU2ntvvun2ptZVIOMcJGDPz53lU7K5DJPrXStWecb4+FlAkLTH9BL1zScEkwcronAi K9tw== X-Gm-Message-State: AOPr4FW2HN4LwuaM/7JAuqiZkAu1S2U5YdC+dT9vuCuCm0gwCzDBQr7G5ZwbsuXQY8Rr4s3KMOQ= X-Received: by 10.112.14.97 with SMTP id o1mr635904lbc.17.1462981482767; Wed, 11 May 2016 08:44:42 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 08:44:42 -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:42:20 +0200 Message-Id: <1462984942-53326-37-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 36/38] linux-generic: test: ringtest: 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" ringtest.c is changed to use the implementation agnostic ODP thread create and join functions, from helpers. ringtest is hence no longer aware on how the odpthread is implemented. Signed-off-by: Christophe Milard --- platform/linux-generic/test/ring/ringtest.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/platform/linux-generic/test/ring/ringtest.c b/platform/linux-generic/test/ring/ringtest.c index ac0aa61..a613fe7 100644 --- a/platform/linux-generic/test/ring/ringtest.c +++ b/platform/linux-generic/test/ring/ringtest.c @@ -351,7 +351,7 @@ static void test_ring_stress(stress_type_t type) } } -static void *test_ring(void *arg) +static int test_ring(void *arg) { ring_arg_t *parg = (ring_arg_t *)arg; int thr; @@ -414,18 +414,17 @@ static void *test_ring(void *arg) fflush(stdout); - return parg; + return 0; } int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) { ring_arg_t rarg; - odph_linux_pthread_t thread_tbl[MAX_WORKERS]; + odph_odpthread_t thread_tbl[MAX_WORKERS]; odp_cpumask_t cpu_mask; - int num_workers; char ring_name[_RING_NAMESIZE]; odp_instance_t instance; - odph_linux_thr_params_t thr_params; + odph_odpthread_params_t thr_params; if (odp_init_global(&instance, NULL, NULL)) { LOG_ERR("Error: ODP global init failed.\n"); @@ -439,7 +438,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) _ring_tailq_init(); - num_workers = odp_cpumask_default_worker(&cpu_mask, MAX_WORKERS); + odp_cpumask_default_worker(&cpu_mask, MAX_WORKERS); rarg.thrdarg.numthrds = rarg.thrdarg.numthrds; rarg.thrdarg.testcase = ODP_RING_TEST_BASIC; @@ -451,8 +450,8 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) thr_params.instance = instance; printf("starting stess test type : %d..\n", rarg.stress_type); - odph_linux_pthread_create(&thread_tbl[0], &cpu_mask, &thr_params); - odph_linux_pthread_join(thread_tbl, num_workers); + odph_odpthreads_create(&thread_tbl[0], &cpu_mask, &thr_params); + odph_odpthreads_join(thread_tbl); rarg.thrdarg.testcase = ODP_RING_TEST_STRESS; rarg.stress_type = one_enq_one_deq; @@ -475,8 +474,8 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) thr_params.start = test_ring; thr_params.arg = &rarg; - odph_linux_pthread_create(&thread_tbl[0], &cpu_mask, &thr_params); - odph_linux_pthread_join(thread_tbl, num_workers); + odph_odpthreads_create(&thread_tbl[0], &cpu_mask, &thr_params); + odph_odpthreads_join(thread_tbl); fail: if (odp_term_local()) {