From patchwork Thu Aug 21 16:01:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 35774 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4B05520540 for ; Thu, 21 Aug 2014 16:01:53 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf81122474pab.9 for ; Thu, 21 Aug 2014 09:01:52 -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=KmM5xm3no/+S9tXH1KRBmeec10yyJGZzUMU0GgpGX1w=; b=GEhQOXgn0c60KMySBJFI+7s2Sul1jmqBsnzinEbvnFNQo0oN+7uw5h3dsSs374Osuo kjgIFST3SkBB400P787nmrmG48TZ7g2eFqgp6sa6YPjozjbhi2l0lXPX3BpfGVzeiKnj 1WXoQEwUAzfRKYblpyjcaBVDU9/jRc/1LInuhR1A7rWHqOOinsKORzNlivp9gvxTxlKs jUiGss8n9V/YKLy6BKEbcJYEbRaSsZDeOyJKwDw1+CRTkftwIbVwX9DylsuBB8mINB9v 7RXGLIWVflVWlWeyopIXXMNfnVZZVW+PJfOBrXrP2TVLa02X9kycd1xCV3TK4CbylCEW IHow== X-Gm-Message-State: ALoCoQnfil43PNdI+58gBZpYo5KxgFmgVjq57T41nWAxI4bAABcuqOlHgeEu36caFD+e/J/h+2ee X-Received: by 10.66.66.46 with SMTP id c14mr30516734pat.21.1408636912593; Thu, 21 Aug 2014 09:01:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.240 with SMTP id n103ls816676qgd.13.gmail; Thu, 21 Aug 2014 09:01:52 -0700 (PDT) X-Received: by 10.220.167.9 with SMTP id o9mr42612157vcy.8.1408636912247; Thu, 21 Aug 2014 09:01:52 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ss5si12471520vdc.106.2014.08.21.09.01.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 09:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so10966436vcb.19 for ; Thu, 21 Aug 2014 09:01:52 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr646973vcd.49.1408636912158; Thu, 21 Aug 2014 09:01:52 -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.45.67 with SMTP id uj3csp147207vcb; Thu, 21 Aug 2014 09:01:51 -0700 (PDT) X-Received: by 10.229.136.133 with SMTP id r5mr71685160qct.31.1408636911340; Thu, 21 Aug 2014 09:01:51 -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 e7si39090097qaa.98.2014.08.21.09.01.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 21 Aug 2014 09:01:51 -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 1XKUo5-0002yV-K8; Thu, 21 Aug 2014 16:01:45 +0000 Received: from mail-qa0-f45.google.com ([209.85.216.45]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XKUo0-0002xT-70 for lng-odp@lists.linaro.org; Thu, 21 Aug 2014 16:01:40 +0000 Received: by mail-qa0-f45.google.com with SMTP id cm18so8444642qab.32 for ; Thu, 21 Aug 2014 09:01:35 -0700 (PDT) X-Received: by 10.140.104.138 with SMTP id a10mr84609750qgf.19.1408636894795; Thu, 21 Aug 2014 09:01:34 -0700 (PDT) Received: from fedora1.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id a8sm47217345qat.28.2014.08.21.09.01.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Aug 2014 09:01:34 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 21 Aug 2014 12:01:26 -0400 Message-Id: <1408636886-14474-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] Add-global_init-paramiters 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: mike.holmes@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.174 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 Signed-off-by: Mike Holmes --- example/generator/odp_generator.c | 2 +- example/l2fwd/odp_l2fwd.c | 2 +- example/odp_example/odp_example.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 2 +- include/odp_init.h | 22 +++++++++++++++++++--- platform/linux-dpdk/odp_init.c | 3 ++- platform/linux-generic/odp_init.c | 3 ++- platform/linux-keystone2/odp_init.c | 3 ++- test/api_test/odp_common.c | 2 +- 10 files changed, 31 insertions(+), 12 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 9fa9b37..ba7aa68 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -525,7 +525,7 @@ int main(int argc, char *argv[]) int core_count; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index d74449a..f8d6729 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) odp_pktio_t pktio; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index f0bdf29..3d38ac7 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -951,7 +951,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { printf("ODP global init failed.\n"); return -1; } diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f247bd0..f3543a0 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -311,7 +311,7 @@ int main(int argc, char *argv[]) int core_count; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index dbe0e5b..1af8c2b 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { printf("ODP global init failed.\n"); return -1; } diff --git a/include/odp_init.h b/include/odp_init.h index 490324a..45db5f5 100644 --- a/include/odp_init.h +++ b/include/odp_init.h @@ -23,23 +23,39 @@ extern "C" { #include +/** + * ODP initialisation + * Data that is required to initialize the ODP + * application, such as specifying a logging callback, the log level etc. + */ +typedef struct odp_global_init { +} odp_global_init_t; +/** + * ODP platform initialization + * Platform specific data. ODP does nothing with + * this data. + */ +typedef struct odp_global_platform_init { +} odp_global_platform_init_t; /** - * Perform global ODP initalisation. + * Perform global ODP initialisation. * * This function must be called once before calling * any other ODP API functions. * * @return 0 if successful */ -int odp_init_global(void); +int odp_init_global(odp_global_init_t *params, + odp_global_platform_init_t *platform_params); /** - * Perform thread local ODP initalisation. + * Perform thread local ODP initialisation. * * All threads must call this function before calling + * * any other ODP API functions. * @param thr_id Thread id * @return 0 if successful diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c index ecc2066..c3f937d 100644 --- a/platform/linux-dpdk/odp_init.c +++ b/platform/linux-dpdk/odp_init.c @@ -50,7 +50,8 @@ int odp_init_dpdk(void) return 0; } -int odp_init_global(void) +int odp_init_global(odp_global_init_t *params ODP_UNUSED, + odp_global_platform_init_t *platform_params ODP_UNUSED) { odp_thread_init_global(); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 5b7e192..8b339e4 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -9,7 +9,8 @@ #include -int odp_init_global(void) +int odp_init_global(odp_global_init_t *params ODP_UNUSED, + odp_global_platform_init_t *platform_params ODP_UNUSED) { odp_thread_init_global(); diff --git a/platform/linux-keystone2/odp_init.c b/platform/linux-keystone2/odp_init.c index f832551..3111b51 100644 --- a/platform/linux-keystone2/odp_init.c +++ b/platform/linux-keystone2/odp_init.c @@ -90,7 +90,8 @@ static int ti_init_hw_config(void) } -int odp_init_global(void) +int odp_init_global(odp_global_init_t *init_data ODP_UNUSED, + odp_global_platform_init_t *platform_params ODP_UNUSED) { odp_thread_init_global(); diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index 89ebd2d..fc583c0 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -56,7 +56,7 @@ int odp_test_global_init(void) { memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("ODP global init failed.\n"); return -1; }