From patchwork Mon Jun 12 19:42:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 103673 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp81976qgd; Mon, 12 Jun 2017 12:44:45 -0700 (PDT) X-Received: by 10.233.223.199 with SMTP id t190mr22207156qkf.247.1497296685336; Mon, 12 Jun 2017 12:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497296685; cv=none; d=google.com; s=arc-20160816; b=ZYkD/+NbpDrKX+1zPYR79Htd3SVNEKqQ9SG9xgT4IrTLLtbhtSX/Qx3RXbV5J+kBJ2 nZa713csh1vufJ68e6h6qmShxc0CU7lQ6We9+/VfB0Gmh1AAq7//tlRNKngdDmKbs9Od C9/BpUCt4CWUVgg3dUlZzJ22YFP2/MXdmMM62hlu3n19AscrbXZqSdxhIroGItYSgskv ehctEYVsS4609NTFR5RwMpa4pu56ZPrV0MU4RXENsWw5IUA04SIOmC4UNMsn8a02gG+I bG8ASZJyE0zwsauaha/kXLu0IetSsJqbMVzPQXSWMtf1IUlEm9q8YEa/kZcqhUvN1j6p uDxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=F+Nh4Sug9sNY6KSSLhPzJSavPumXjiZ5LVB1dfcTznY=; b=J3T6Cnm5ywMuZx/3Z5rKBi0JRM2LCmXUZ/d35Ya0tX83c98MaWbs+5x1Ey2ROjcifE OSbEFKrIuYbwThgNTn+Y1snyeezTJZ3AvGHYr2XkaICbtmoZapyFr5ueE4sbui5FCNTu /jj8kbzzQVBoQqtMytxdocr4yn0VliRB/k+aCm3ScfVh17qY5glZVAwSUjlgxJ3mWQxK KNa9TTUeDZ/N4eY23+/5yhAvqBXCa/FthPc6rZ7x5b59U7I4ORAW6VPsMambwy3V5in/ bOXKZYPvslYc8Wvj3NOueATbYlG73Pcm2gwYJUpQINc7t/yEggRMkq8nnX5JZLAnWlI1 C7Rg== ARC-Authentication-Results: i=1; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d81si6667407qke.262.2017.06.12.12.44.45; Mon, 12 Jun 2017 12:44:45 -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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 13F7B609A8; Mon, 12 Jun 2017 19:44:45 +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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, 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 AA6CB60C02; Mon, 12 Jun 2017 19:42:59 +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 374AF60A36; Mon, 12 Jun 2017 19:42:52 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by lists.linaro.org (Postfix) with ESMTPS id 6C36860993 for ; Mon, 12 Jun 2017 19:42:13 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id k145so49241859oih.3 for ; Mon, 12 Jun 2017 12:42:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F+Nh4Sug9sNY6KSSLhPzJSavPumXjiZ5LVB1dfcTznY=; b=CbnOF0fCDX07/gDxH6fJy7/By2jVqZ5om7fWv2AGGnm4DsEvPVUHE9mYJSrK3n2uDF I1RC+dXldf3XxZ7YSb2h3FO5DCLeTMvw5ge323FNRcbZnagLWBL3Yu2V+zdohPS+SJCk nREFf5DdJJUoZaUN2FZWK4P3N8hf8T7PtCBwzS16LNFNmpRydndn6qJZjwjye3Rr5lxN v+RJszvJ/RxS2b9qLe1uAbWyiVetrghQBmzOWDALT4voPVLh1+NW6or/GQ5O7NLyGywm QJmidBE06I+avJtYRds+U2ztjAtulss0IzZ9KmNMGPSHkSfS5LeGuTg81Lqo4oOi0fKK qiGQ== X-Gm-Message-State: AODbwcAReDHJEl9LLHpJYCig5xTKV7SRFrUBAJwJiIscQUhn7X8sDymm W6qdRWYA9zWx0B/Nh4GasQwY X-Received: by 10.202.98.68 with SMTP id w65mr29884743oib.173.1497296532637; Mon, 12 Jun 2017 12:42:12 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id c93sm4698347otb.38.2017.06.12.12.42.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 12:42:12 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 12 Jun 2017 14:42:05 -0500 Message-Id: <20170612194205.8592-5-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170612194205.8592-1-bill.fischofer@linaro.org> References: <20170612194205.8592-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv4 5/5] doc: feature: add odp_init_global() documentation for unused features 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bill Fischofer --- doc/users-guide/users-guide.adoc | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index ead8da5e..d78e0777 100755 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -530,20 +530,44 @@ calling the terminate functions should only be done when the application is sure it has closed the ingress and subsequently drained all queues, etc. === Startup -The first API that must be called by an ODP application is 'odp_init_global()'. +The first API that must be called by an ODP application is `odp_init_global()`: +[source,c] +----- +int odp_init_global(odp_instance_t *instance, + const odp_init_t *param, + const odp_platform_init_t *platform_param); +----- This takes two pointers. The first, `odp_init_t`, contains ODP initialization data that is platform independent and portable, while the second, `odp_platform_init_t`, is passed unparsed to the implementation to be used for platform specific data that is not yet, or may never be -suitable for the ODP API. +suitable for the ODP API. Each of these parameters is optional and may be +specified as NULL to accept the implementation-defined default initialization +values. -Calling odp_init_global() establishes the ODP API framework and MUST be +Calling `odp_init_global()` establishes the ODP API framework and MUST be called before any other ODP API may be called. Note that it is only called -once per application. Following global initialization, each thread in turn +once per application. A successful call to `odp_init_global()` returns rc = 0 +and sets the `instance` variable supplied as input to the call to an handle +representing this unique ODP instance. + +The `odp_init_t` parameter is used to specify various customizations to the +ODP environment being established by this call. For example, the caller can +specify the maximum number of worker threads it will use, the thread masks +associated with these threads, as well as whether the default logging or +abort functions are to be overridden with an application-supplied handler. + +The application may also provide optimization hints to the ODP implementation +if it knows that it will never use specific ODP feature sets, such as the +packet classifier or traffic manager. Implementations may use such hints to +provide optimized behavior to applications that are known not to need these +features. + +Following global initialization, each thread in turn calls 'odp_init_local()'. This establishes the local ODP thread context for that thread and MUST be called before other ODP APIs may be -called by that thread. The sole argument to this call is the _thread type_, -which is either `ODP_THREAD_WORKER` or `ODP_THREAD_CONTROL`. +called by that thread. The sole argument to this call is the `instance` +variable returned by `odp_init_global()`. === Shutdown Shutdown is the logical reverse of the initialization procedure, with