From patchwork Tue Jun 13 12:55:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105164 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp450098obh; Tue, 13 Jun 2017 05:57:17 -0700 (PDT) X-Received: by 10.237.53.102 with SMTP id b35mr67562250qte.83.1497358637754; Tue, 13 Jun 2017 05:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497358637; cv=none; d=google.com; s=arc-20160816; b=EM3hAwAI6xkQJh/3LIVVGC+bvqFHELglS8BYyH/+lufT+oZ4xFr3I3cNkDAiRTRd5G Zlqh35AdR+kB2m4Y55he2BXYVeOY79cy6rnWvjEpEvOrLlumNY1NF/8cLXSYL7Tk4G09 wP/4UNyIYymS4BF1uOlJlRL8CyIfH65F1BAEqNlrUriyDcUd9Gk8itXdju8ZG+5x/W1m kVxJhssu9XNVtxP1HTw3y7QNecyDaOab6KDXe35rVbhjA6F8unqxgyOIPeUy64JIFx8L GteYHXt7sdkMPVhchX/8nCti1ibvBQ9yGM6pzETPkaDfPc/SeAkYnRRwgIhEloXuO3mS ujYQ== 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=pk/gNV3fd6oeKOKecKjBBx2mY0K+G5WFcXJbM7Pl9Og=; b=rQbk0JFn4KEEl41X7OmN+poRQYh1On55Rc2RZ3MzKfePuks49PvOuerVvCjbZmDPNn Nul0dZPzIkjed9xb2x7Hsa293u863ZwTeZK9xdAOEzMKuC3/YR3KJseEHi5IxTYGO0KB ni5jaNM+qbWCX3o/yx/5DLbcGJwLCANnFmqWTzqI6Z23v3uudk4ovJ2Nfay7yaU6eTTo EX0vzdeqZOEAxvSlHeN2PkyqRNHg/Zrk4v5vp5RlqknTenrpTr9AC1BFrMfP3KLOATvn it1xZz2Z5wPXWxxRHcgf61NSJv7NwXEw3FiV+Bll2YUdku74TMbfhjm0UGTTxD0qB6R3 cUug== 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 127si11385664qkm.159.2017.06.13.05.57.17; Tue, 13 Jun 2017 05:57:17 -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 3FDD460BFA; Tue, 13 Jun 2017 12:57:17 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 D53F060BFD; Tue, 13 Jun 2017 12:56:08 +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 8EAF060BFE; Tue, 13 Jun 2017 12:56:01 +0000 (UTC) Received: from mail-ot0-f177.google.com (mail-ot0-f177.google.com [74.125.82.177]) by lists.linaro.org (Postfix) with ESMTPS id A77C2609E3 for ; Tue, 13 Jun 2017 12:55:23 +0000 (UTC) Received: by mail-ot0-f177.google.com with SMTP id t31so87064422ota.1 for ; Tue, 13 Jun 2017 05:55:23 -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=pk/gNV3fd6oeKOKecKjBBx2mY0K+G5WFcXJbM7Pl9Og=; b=U0CAKQW3MxZZKze8W5nvrEA5voaZOZCAq/bf3x35o3vO99yvMswXUwlsQAL46V4FIq SWMq9NRaAs1J5qON+wCqcz4arodUQK5PA9T0Hs8oGWOUu9nHGUGyGxz2S69Tx0McAB0d Wj8hdMRmFOpFaRKKDZ/Ld+061rwnc+AN9iePVb+lejzEZQ2ewPXBlAKBmPwWLyUQMbNY 2Un+UT0YSmvWq19PsN1hFRa5qp5/dkOZLBjURazhIxPI6VDaDGWrEyfJi/nE0JRP2MNP W3ewpb86Aqr//mVFQ3eB28t5rTNGjdYl9ATjafsWTKM/Q/NuU4ZfS35rn1DwN5tGUKIE rkWQ== X-Gm-Message-State: AKS2vOyS7lsUlH1mJoRBDv9xXd5hlTcRIjfPKQh+wJ6CynlM/V1C/b3u 88XkbXf5w5cUFUvtE1ctid6o X-Received: by 10.157.53.22 with SMTP id o22mr388706otc.155.1497358522877; Tue, 13 Jun 2017 05:55:22 -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 f35sm6530517otd.15.2017.06.13.05.55.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:55:22 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:55:15 -0500 Message-Id: <20170613125515.24874-5-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613125515.24874-1-bill.fischofer@linaro.org> References: <20170613125515.24874-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv7 5/5] doc: userguide: 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" Update User Guide startup section to include current parameters for odp_init_global() and odp_init_local() as well as optimization hints for unused features. 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