From patchwork Mon Aug 4 05:37:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 34762 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B80FE21F5F for ; Mon, 4 Aug 2014 05:37:57 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id 29sf24916011yhl.10 for ; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) 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:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=dAWj3r6kkPzqmV+hcwYivab1dItgQR6spzhon3vG8j4=; b=giT2iCt6NxTW7WK8lkVLSTbAQIvhhdcQ5UbNQIs+NqHoVkPTSKJXcOdutUQ+jyjhm3 nkxfsSGlUOO//VoQ17Q3z1fDUdYEtFbjfi19u0j0RPouDZIF8hzGDNVELH3KXBQdz5sK z1odz4OpfvtQiDfqFXfug8eQ7/5D+wRlE3nSuiWmbY3uGwkRXBtAC87Bf0S9qNNNVZuB rHmqr3HcF9s6tzALa9VGF5iRyGUVMJYaB7gaX0s2AqUD+Ohz5s9zVOaVn0RahBbezvjY d1g/S/0m0YBAKwnouVVTQ4DSjzkqatSHiR8XlsxIoMxqxyU6Delr8JBajtm26K77t2tr 94YQ== X-Gm-Message-State: ALoCoQkZx3LeY0r9YpHttfKPVqzq60LhewKwJO5gVifJHVJ+t0qIH20wVzG5VLa+nPwfBaTuOp7h X-Received: by 10.236.105.197 with SMTP id k45mr7188822yhg.19.1407130677578; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.18 with SMTP id v18ls2145439qge.51.gmail; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) X-Received: by 10.52.253.39 with SMTP id zx7mr17899261vdc.2.1407130677501; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id db12si11334219vdd.101.2014.08.03.22.37.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:37:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id le20so10185579vcb.0 for ; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) X-Received: by 10.220.92.5 with SMTP id p5mr21163440vcm.7.1407130677357; Sun, 03 Aug 2014 22:37:57 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp278613vcb; Sun, 3 Aug 2014 22:37:56 -0700 (PDT) X-Received: by 10.140.107.4 with SMTP id g4mr30853068qgf.100.1407130676819; Sun, 03 Aug 2014 22:37:56 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id z5si26872866qgz.64.2014.08.03.22.37.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:37:56 -0700 (PDT) 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-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEAy3-0006gr-Co; Mon, 04 Aug 2014 05:37:55 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEAxx-0006gl-Nq for lng-odp@lists.linaro.org; Mon, 04 Aug 2014 05:37:49 +0000 Received: by mail-pa0-f42.google.com with SMTP id lf10so9416120pab.1 for ; Sun, 03 Aug 2014 22:37:44 -0700 (PDT) X-Received: by 10.70.65.100 with SMTP id w4mr372111pds.128.1407130664095; Sun, 03 Aug 2014 22:37:44 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id dd9sm24843697pdb.42.2014.08.03.22.37.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:37:43 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Mon, 4 Aug 2014 11:07:18 +0530 Message-Id: <1407130639-3417-1-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: patch Subject: [lng-odp] [ODP/PATCH 1/2] linux-generic: Fix incorrect thread_tbl index in apps 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: santosh.shukla@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.220.169 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 few of odp example and test application passing incorrect thread_tbl index entry (thread_tbl base addr) to odp_linux_pthread_create(thread_tbl^^, 1, ..) api. This patch a common fix for those odp application. Signed-off-by: Santosh Shukla --- Note - tested only odp_timer_ping application, works fine avoid segfault for pthread_join, Its a trivial fix should work for all other application. appl module original author pl. raise your concerns incase if you suspect on this patch. Thanks. example/generator/odp_generator.c | 6 +++--- example/l2fwd/odp_l2fwd.c | 2 +- example/packet/odp_pktio.c | 2 +- example/packet_netmap/odp_pktio_netmap.c | 4 ++-- test/api_test/odp_timer_ping.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index e4a72fa..b10372e 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -611,13 +611,13 @@ int main(int argc, char *argv[]) args->thread[1].pktio_dev = args->appl.if_names[0]; args->thread[1].pool = pool; args->thread[1].mode = args->appl.mode; - odp_linux_pthread_create(thread_tbl, 1, 0, + odp_linux_pthread_create(&thread_tbl[1], 1, 0, gen_recv_thread, &args->thread[1]); args->thread[0].pktio_dev = args->appl.if_names[0]; args->thread[0].pool = pool; args->thread[0].mode = args->appl.mode; - odp_linux_pthread_create(thread_tbl, 1, 0, + odp_linux_pthread_create(&thread_tbl[0], 1, 0, gen_send_thread, &args->thread[0]); /* only wait send thread to join */ @@ -649,7 +649,7 @@ int main(int argc, char *argv[]) * because each thread might get different arguments. * Calls odp_thread_create(cpu) for each thread */ - odp_linux_pthread_create(thread_tbl, 1, + odp_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func, &args->thread[i]); } diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index e331ff2..f89ea7a 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -411,7 +411,7 @@ int main(int argc, char *argv[]) thr_run_func = pktio_ifburst_thread; else /* APPL_MODE_PKT_QUEUE */ thr_run_func = pktio_queue_thread; - odp_linux_pthread_create(thread_tbl, 1, core, thr_run_func, + odp_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func, &gbl_args->thread[i]); } diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index edf8cfd..247a28a 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -375,7 +375,7 @@ int main(int argc, char *argv[]) * because each thread might get different arguments. * Calls odp_thread_create(cpu) for each thread */ - odp_linux_pthread_create(thread_tbl, 1, core, thr_run_func, + odp_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func, &args->thread[i]); } diff --git a/example/packet_netmap/odp_pktio_netmap.c b/example/packet_netmap/odp_pktio_netmap.c index 7d33b19..b49aa61 100644 --- a/example/packet_netmap/odp_pktio_netmap.c +++ b/example/packet_netmap/odp_pktio_netmap.c @@ -334,8 +334,8 @@ int main(int argc, char *argv[]) * Create threads one-by-one instead of all-at-once, * because each thread might get different arguments */ - odp_linux_pthread_create(thread_tbl, 1, i, pktio_queue_thread, - NULL); + odp_linux_pthread_create(&thread_tbl[i], 1, i, + pktio_queue_thread, NULL); } /* Master thread waits for other threads to exit */ diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index cd67e0d..88650d6 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -367,7 +367,7 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) run_thread = send_ping; /* Create and launch worker threads */ - odp_linux_pthread_create(thread_tbl, 1, i, + odp_linux_pthread_create(&thread_tbl[i], 1, i, run_thread, (pthrd_arg *)&pingarg); }