From patchwork Wed Mar 23 13:09:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 64224 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp18786lbc; Wed, 23 Mar 2016 06:10:12 -0700 (PDT) X-Received: by 10.107.136.144 with SMTP id s16mr3480701ioi.88.1458738609135; Wed, 23 Mar 2016 06:10:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g5si5393832igg.12.2016.03.23.06.10.08; Wed, 23 Mar 2016 06:10: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 Received: by lists.linaro.org (Postfix, from userid 109) id 0B67A61673; Wed, 23 Mar 2016 13:10:08 +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 B522661655; Wed, 23 Mar 2016 13:10:04 +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 40FB66162E; Wed, 23 Mar 2016 13:09:49 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id 65117615CD for ; Wed, 23 Mar 2016 13:09:47 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id d82so10792801lfe.3 for ; Wed, 23 Mar 2016 06:09:47 -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; bh=tqjw4J9SDTcxdjhyOMDienWo7wlEfX8SijYZtC7wx4k=; b=czo8cu8GIjilN73Tx5tXhHr3l2ap59mmIUcEMBxIcDsbRprcXnnAprImNZiN8rzLU8 vYzSSKYxr5GL0Jm/F6FWIzzChrpV+Kg2j2d375k60wfCzzZwSoykXkECBrzOqUt7+44v Ev9ze7sDgIP7f/+C9XpoGEGwZtr1BBDGXUw3kgvoavmIb5iXAeMdr5Gu8+pNsrk+T7nT n3Bl3uchAwaxwppOx39nnXGrx7w5IEiQNaT7uTQSl+6zzv3IkgWrVjeI0JI+zRGrai83 308dVDj1Mkjt1Mf7xV8WBpaS9WF+2aqGGIy5dawLAZ/J8F89u76qUehtzW94CEKjzPZN /GIA== X-Gm-Message-State: AD7BkJIT4d3lJXPS0Y/Y+48AWO8q5+zvyivnpdH3TqYJ9dRKp0qK8siYZkPfL3qpXVE3pbXpyss= X-Received: by 10.25.42.1 with SMTP id q1mr1187264lfq.87.1458738586151; Wed, 23 Mar 2016 06:09:46 -0700 (PDT) Received: from localhost.localdomain (ppp91-77-172-79.pppoe.mtu-net.ru. [91.77.172.79]) by smtp.gmail.com with ESMTPSA id jm10sm396516lbc.34.2016.03.23.06.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Mar 2016 06:09:45 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 23 Mar 2016 16:09:45 +0300 Message-Id: <1458738585-12123-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2] example: generator: add missing instance set 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" Patch: api: init: add instance handle adds instance id, but for generator one branch of threads start is missing which lead to failure of odp_init_global(). Add missing instance id and initial missing structure initialization to zero. Signed-off-by: Maxim Uvarov --- example/generator/odp_generator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 8f69c9c..4bfbc68 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -738,6 +738,11 @@ int main(int argc, char *argv[]) /* Create and init worker threads */ memset(thread_tbl, 0, sizeof(thread_tbl)); + /* Init threads params */ + memset(&thr_params, 0, sizeof(thr_params)); + thr_params.thr_type = ODP_THREAD_WORKER; + thr_params.instance = instance; + if (args->appl.mode == APPL_MODE_PING) { odp_cpumask_t cpu_mask; odp_queue_t tq; @@ -762,11 +767,8 @@ int main(int argc, char *argv[]) abort(); args->thread[1].mode = args->appl.mode; - memset(&thr_params, 0, sizeof(thr_params)); thr_params.start = gen_recv_thread; thr_params.arg = &args->thread[1]; - thr_params.thr_type = ODP_THREAD_WORKER; - thr_params.instance = instance; odph_linux_pthread_create(&thread_tbl[1], &cpu_mask, &thr_params);