From patchwork Wed Oct 8 12:32:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38471 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BBFB2202E7 for ; Wed, 8 Oct 2014 12:32:41 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf4008840wib.1 for ; Wed, 08 Oct 2014 05:32:39 -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=EaRgxfZ7D//3txxO02AkzRM3Q99vPOU6SB4jhRmiBYE=; b=jhse3nm2j1NAVHQxmE0XZKLkHtcUoWtAA3aW2H2OasOv0alM2YAMzQlUPgGWHl+RRW NIWTgdgXiwQlSCj4ai3GunvrTKVShbL6MBUyo4g7/u4gk6mFt1goXDHo/9kLBs9L/Xm9 ZcQIH1/ta7kGbdwjdirMni2FUuM8iZkOGXeDU5k7VZ1c+LlCs2IvtqRP7j0mxpBxkkNQ IPOZelgDU2tJjjCTPCkh+fgPAcgDF2GzkucEnuNnWyJCjl/y6BfbrVkxdznZAb/XdPsg 0PomEWaEdPaUQBjmKlo8iia28Ai7MPYU+/MzBLf+XbyVjSWSwOjmnXjGqyCdllDQbWlY TZ0A== X-Gm-Message-State: ALoCoQnLUwircuo0DhdxpsyfVm58zw1zWJ4ipuuevlqNSC1iN8kz7S5As2R8M1eyF9sBwyCmxVdE X-Received: by 10.180.106.197 with SMTP id gw5mr4479515wib.1.1412771559842; Wed, 08 Oct 2014 05:32:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.40 with SMTP id 8ls49670laj.65.gmail; Wed, 08 Oct 2014 05:32:39 -0700 (PDT) X-Received: by 10.112.7.101 with SMTP id i5mr10697328lba.57.1412771559581; Wed, 08 Oct 2014 05:32:39 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id xv1si32811375lbb.119.2014.10.08.05.32.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 05:32:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id pn19so8385347lab.14 for ; Wed, 08 Oct 2014 05:32:39 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr11231394lad.40.1412771559420; Wed, 08 Oct 2014 05:32:39 -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.112.84.229 with SMTP id c5csp53267lbz; Wed, 8 Oct 2014 05:32:38 -0700 (PDT) X-Received: by 10.220.68.77 with SMTP id u13mr4425775vci.75.1412771557656; Wed, 08 Oct 2014 05:32:37 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id xn5si12512768vcb.95.2014.10.08.05.32.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 Oct 2014 05:32:37 -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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XbqPz-0000gl-Sm; Wed, 08 Oct 2014 12:32:35 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XbqPt-0000ga-BR for lng-odp@lists.linaro.org; Wed, 08 Oct 2014 12:32:29 +0000 Received: by mail-qg0-f43.google.com with SMTP id j107so6900755qga.16 for ; Wed, 08 Oct 2014 05:32:24 -0700 (PDT) X-Received: by 10.140.85.73 with SMTP id m67mr74242qgd.97.1412771544115; Wed, 08 Oct 2014 05:32:24 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id q6sm16736544qas.16.2014.10.08.05.32.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Oct 2014 05:32:23 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 8 Oct 2014 08:32:07 -0400 Message-Id: <1412771527-35429-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v10] Add global_init params 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.215.41 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 Reviewed-by: Ciprian Barbu --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.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 +- platform/linux-generic/include/api/odp_init.h | 35 +++++++++++++++++++++------ platform/linux-generic/odp_init.c | 3 ++- test/api_test/odp_common.c | 2 +- 9 files changed, 36 insertions(+), 16 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6055324..eb8b340 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -519,7 +519,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* 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/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index ec6c87a..2f2dc19 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1176,7 +1176,7 @@ main(int argc, char *argv[]) odp_shm_t shm; /* 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 8aa0ba0..57037cd 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -319,7 +319,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* 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 47d764e..0e9aa3d 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -985,7 +985,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); /* ODP global init */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("ODP global init failed.\n"); return -1; } diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 145ae47..2cf3f0d 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -299,7 +299,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* 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 87900fc..78b2ae2 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -256,7 +256,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/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 13c8e44..fab4f6e 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -8,7 +8,7 @@ /** * @file * - * ODP initialisation + * ODP initialization */ #ifndef ODP_INIT_H_ @@ -24,20 +24,39 @@ extern "C" { +/** ODP initialization data. + * Data that is required to initialize the ODP API with the + * application specific data such as specifying a logging callback, the log + * level etc. + */ +typedef struct odp_init_t { +} odp_init_t; + +/** ODP platform initialization data. + * @note ODP API does nothing with this data. It is the underlying + * implementation that requires it and any data passed here is not portable. + * It is required that the application takes care of identifying and + * passing any required platform specific data. + */ + +typedef struct odp_platform_init_t { +} odp_platform_init_t; + /** - * Perform global ODP initalisation. - * - * This function must be called once before calling - * any other ODP API functions. + * Perform global ODP initialization. * + * This function must be called once before calling any other ODP API + * functions. + * @param[in] params Those parameters that are interpreted by the ODP API + * @param[in] platform_params Those parameters that are passed without + * interpretation by the ODP API to the implementation. * @return 0 if successful */ -int odp_init_global(void); - +int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params); /** - * Perform thread local ODP initalisation. + * Perform thread local ODP initialization. * * All threads must call this function before calling * any other ODP API functions. diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 55fa53a..c97c5aa 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_init_t *params ODP_UNUSED, + odp_platform_init_t *platform_params ODP_UNUSED) { odp_system_info_init(); diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index b0a6fbc..ed1fc97 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; }