From patchwork Mon Jun 12 20:54:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 103679 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp106062qgd; Mon, 12 Jun 2017 13:57:11 -0700 (PDT) X-Received: by 10.237.48.229 with SMTP id 92mr33960460qtf.156.1497301031070; Mon, 12 Jun 2017 13:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497301031; cv=none; d=google.com; s=arc-20160816; b=P4hvS579BmWU9vqAd79J9ZBHcbFP1XMbmbU5+9k+pqHLk/HOAn+5BHSawn9bp7Awhv Lt3s4xOTRGU+3zbi4Tmiseheenmd77gnQfCpuxLULXIHJEMArRkgexu1v3gc1Ag683zw ERrpUnQuU3cU1/GvgiXwKlYlzT9stqv/4RLBHeuKIZsUFV1kVuKoo5pCjF48mkRpWjuH lOz4AE1xkE367/qPNYZYKri0DPKlIclsYjjT1FqJSCToTxkfI0vMhVH/t1hLbe6RMlDh O4TSWrnDQEu0FGsl5d65576rUcrIMmHjhsjVAKVgjYc8UqwuTpSxG550Z0W6II59jQ52 Pkpg== 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=jhTI1D2IGJMN2NdPHKWAO5K+Oq6MqayiRZuZkpLnpDIH2Jf3jUN8GmiG7Lwn8gwKja ZZ4LLgtj9YgTvynPJgyqgJyDxYk3NyFmA0DVQVtigkTjnDNAkJZDs9gQ+mkA1avScKNb 4dpEa6+8Ixw1l8Y3LOPBr8Y9CYIdakDnDas2kPvZP3dltieNnsrQWQU6zca8VoXqM5i4 /DT3HAeAsQCXfm7O5utKzqt8U3y2XXOZ65Ke/J0VEHF7XG35UqcUbq0jKimRwfSamuIa jItfN3QpJme5Wf6zIJGQbDSu9v5/cem5LqGux49l3RfW8HN7nMTOpb14oBRQxz2cOKql VXQw== 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 a17si10170704qka.322.2017.06.12.13.57.10; Mon, 12 Jun 2017 13:57:11 -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 A479060BE7; Mon, 12 Jun 2017 20:57:10 +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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 F3D9560BF6; Mon, 12 Jun 2017 20:55:18 +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 13CC560956; Mon, 12 Jun 2017 20:55:15 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id A6CFD60956 for ; Mon, 12 Jun 2017 20:54:43 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id s3so58971096oia.0 for ; Mon, 12 Jun 2017 13:54:43 -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=UT9TbUH8HERxIK6VOPmhq33chHc7O8Gm1f26y6HbQKiBL6MWgnKHZQxizPSEGejWdn JytBDee7ZVV3Z/9zkVITfWFFQd3XfUBVxVL0LaeQdLBVrH7qdJq0B+kxQxZSuxYmty6o cYkhIUeYcapbO2BlynhvgppBVF9FCkN59Q7/vLhqQNgNaCv5S4T7cS71GQzc9sKU0Vjx S+RcMgtGefTHUGvxsIiyk834rq0nQEUTRglqEqlmMz1UMxigP50ljmNJL5zEmywSX8mq bKNzTyuEVJ16YtrTpxir2zkFdPTBdKzJ4VbHFkN68g3BXc8Ymplp8IzYSihhJZo6KOLJ 0EQQ== X-Gm-Message-State: AODbwcC/PNhCa/AZPsgwnK7QlmC3GOfu5jQ3G8i6VSBcGHIvtPkMgGYJ v9E2JecgqqslgtWH9mbNECTc X-Received: by 10.202.94.198 with SMTP id s189mr29839885oib.202.1497300882692; Mon, 12 Jun 2017 13:54:42 -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 y34sm5427056oty.53.2017.06.12.13.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 13:54:41 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 12 Jun 2017 15:54:34 -0500 Message-Id: <20170612205434.21993-5-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170612205434.21993-1-bill.fischofer@linaro.org> References: <20170612205434.21993-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv5 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