From patchwork Tue Jun 13 12:03:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 105158 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp368276qgd; Tue, 13 Jun 2017 05:05:11 -0700 (PDT) X-Received: by 10.55.150.197 with SMTP id y188mr33122369qkd.26.1497355511661; Tue, 13 Jun 2017 05:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497355511; cv=none; d=google.com; s=arc-20160816; b=fZaurajfm/f6mQBdhLRL0XVS/6dnmAxmlZfd6CAMUIMl3DNJ2vc6XisMPY+IDijonl pQTcggR2v/xO7WSwJqboRaUhwGdrVAcNZwE3KtSzkz1NCcNGowgZ/Q3Rg5ps143p5+ak gGbQNVmM9gIQhzytuysSgRTvvFR94z9CsQA8n2fi569N5+IY1AN97dW1YQsLZYwd1I67 0L3ymF0v38MUe9ogTscmSVQLJ+/FBT0K5476D2qLZ8rf7y8MHBvY/9UvleVk8hiRm5Fm 9EgFXh9aVGh1Ql3jcq9119Gt8srohuqIuri10anuJOg+j73CtGNNqfPWwzF7x7aPR4Ie nJtA== 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=XoI8nSj6xLBseYzwZdRViZhn9LjPeZFPh3ZqaonBXu1QlxVj0ZR8eSt5YiPA0dTPzv SUsJj+pcT6G+mjsiSHMUMKuBVf3pXnDer347f/jfDd6sgKfm1g+SANaQZRWrf1Ldn2ri SjvUjmABVaDgzbmkjZ6euJr6z/1PIw6qOp3QqKH5ElWXH2xPZk8XTS7NDu4VBEcNMh/I lnpmhz/PJrvHJymyOzKpKounJzbWiHY79ibYfj9nhAiLQpbl0qHNSXBeZKq8E2L89YLZ 44hLhERxtFLRKjdpMGbP2lShInEqaL1EdMksvmXwYvg8le4elPA4srjT71WcvHf1a2ZB cRbw== 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 4si4663832qkl.155.2017.06.13.05.05.11; Tue, 13 Jun 2017 05:05: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 56B8960BF4; Tue, 13 Jun 2017 12:05:11 +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 D72C160B2A; Tue, 13 Jun 2017 12:04:02 +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 5051860BF6; Tue, 13 Jun 2017 12:03:59 +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 73F5760BEE for ; Tue, 13 Jun 2017 12:03:32 +0000 (UTC) Received: by mail-ot0-f177.google.com with SMTP id k4so86052255otd.0 for ; Tue, 13 Jun 2017 05:03:32 -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=QQ+xtr/k48wpeYsqhl7GsHNLDmT0q/k89as4S8ncTxGrhSXWfSkEivlJBXZ+iPe/cm qx1+3meQIhYAjrjI+YWQ0tpGtYHLBAMAZ4jJNu/daN28bY3vVc5KW5jNcYIL7svfOEMu 1E65zYTS5bUQrWlIRExcFl4DAIccEOErhjN7c+Pc8RQ7FS3ltNqTN9/vhy0eGPt5NRqe O44pASR0KQ5lA80slkLmfRLh7hJzxXjfbUncqrvf3cwH+nilw/9sX5QyhwsRV0gqTqS1 9nlKukWmaTvQtwwZ8GoUpvPuc0wg/nzNvS4oK2usUWucFpW8T3qcEBR4qVqBkzecnAz0 Oytw== X-Gm-Message-State: AODbwcBdAckb/FUB929faq8fDP5K8npVEaRVLQoWdrJY3IYEoQdfk9js gUMHL/1soNqfOqLXiLXbxTrH X-Received: by 10.157.25.7 with SMTP id j7mr28005478ota.175.1497355411626; Tue, 13 Jun 2017 05:03:31 -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 p3sm6389439ota.51.2017.06.13.05.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 05:03:30 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 13 Jun 2017 07:03:23 -0500 Message-Id: <20170613120323.30475-5-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613120323.30475-1-bill.fischofer@linaro.org> References: <20170613120323.30475-1-bill.fischofer@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv6 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