From patchwork Wed Nov 18 17:03:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 56947 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2681126lbb; Wed, 18 Nov 2015 09:03:25 -0800 (PST) X-Received: by 10.55.75.212 with SMTP id y203mr2589656qka.20.1447866205328; Wed, 18 Nov 2015 09:03:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 89si3062219qgi.63.2015.11.18.09.03.24; Wed, 18 Nov 2015 09:03:25 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id D016461E51; Wed, 18 Nov 2015 17:03:24 +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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 A596361D03; Wed, 18 Nov 2015 17:03:17 +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 3986C61D19; Wed, 18 Nov 2015 17:03:14 +0000 (UTC) Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) by lists.linaro.org (Postfix) with ESMTPS id D391F61D0A for ; Wed, 18 Nov 2015 17:03:07 +0000 (UTC) Received: by qgeb1 with SMTP id b1so32195012qge.1 for ; Wed, 18 Nov 2015 09:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=lxWSLRYRWvFmqFPe606M6IhL8rzWT18mwy04axQdqWU=; b=lNidue9Wa05K6UYxUIRjjB8fpfXlhgP8cGJpWHnytMJyWoHhxnTl1tcI9H3XWLPlh3 +LE/7Foytc5Zj/0L7uzPzl30YmZea6z2PKRAWJxminHsU2+3AwE3ngy2ng8DAKdpp0tF 9AhrJ7naMofncZUosboAlKrI5M026N3fMKWhopyijzNe3aG2XNCX4orZjTq/dm3+9m+r wuzL/K35YXK8CMrUXOk6L8NDp4A75BJRo6fVh4nz51N+HtLuE26IMu9trWUf33lkUeMm b6t1zj596SaEzZxuJbzj85LdoX8NRXg08AAomfZVCrziQiNDjHjJAza+AkGqCj51oS6n PzCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=lxWSLRYRWvFmqFPe606M6IhL8rzWT18mwy04axQdqWU=; b=IxrVte84g+rw5DPTc5hW3Gn8eN6Ipum+Nfe7oh3Ac+fpYeFtZN4Vo/+DvhmoOuNhJu zylyvMsYnlIhBgW+M7iZAaxPHRE82+7RCz8aL+f9U1DGKiF4w6+n0rLOeiODz3WzFuxg U43XiE6sjEYmwtuRhjPleMUCeYXImP3ObBWbgprYBEE3pxv5achgs44UwbH0RQtR1rVE iLxmGO153XvOJvfkFbYF9+cdyeDyN1rXQYWgfV7oRWnwvBp7qtHOrTIJOpJw+BUlQJ74 dRR3dTw6W2MYj7NyAgvSapoPxQaSMF5UlJ7U9XKIVWUx7lTi0erc5bhOJcAe7YF41DrV YIUQ== X-Gm-Message-State: ALoCoQnJcSPA7V0kU1MFqQ47YY+Qbo6hAKohgei+n6KYCr//2ZgJmZhVyNv3IpvPtRaQR09jJ4lp X-Received: by 10.140.17.105 with SMTP id 96mr2662247qgc.34.1447866187500; Wed, 18 Nov 2015 09:03:07 -0800 (PST) Received: from localhost.localdomain (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id a15sm1131087qge.18.2015.11.18.09.03.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Nov 2015 09:03:06 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 18 Nov 2015 12:03:04 -0500 Message-Id: <1447866184-6923-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Topics: patch Subject: [lng-odp] [PATCH] doc: users-guide: convert to ODP standard layout 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: Mike Holmes --- doc/users-guide/users-guide.adoc | 101 +++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 35 deletions(-) diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index be40d2f..e087696 100644 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -8,13 +8,16 @@ OpenDataPlane (ODP) Users-Guide Abstract -------- This document is intended to guide a new ODP application developer. -Further details about ODP may be found at the http://opendataplane.org[ODP] home page. +Further details about ODP may be found at the http://opendataplane.org[ODP] home +page. .Overview of a system running ODP applications image::../images/overview.png[align="center"] -ODP is an API specification that allows many implementations to provide platform independence, automatic hardware acceleration and CPU scaling to high performance networking applications. -This document describes how to write an application that can successfully take advantage of the API. +ODP is an API specification that allows many implementations to provide platform +independence, automatic hardware acceleration and CPU scaling to high +performance networking applications. This document describes how to write an +application that can successfully take advantage of the API. :numbered: == Introduction == @@ -422,23 +425,35 @@ goals. Again, the advantage here is that on many platforms traffic management functions are implemented in hardware, permitting transparent offload of this work. -Glossary --------- +== Glossary == + [glossary] odp_worker:: - An opd_worker is a type of odp_thread. It will usually be isolated from the scheduling of any host operating system and is intended for fast-path processing with a low and predictable latency. Odp_workers will not generally receive interrupts and will run to completion. + An opd_worker is a type of odp_thread. It will usually be isolated from the + scheduling of any host operating system and is intended for fast-path + processing with a low and predictable latency. Odp_workers will not + generally receive interrupts and will run to completion. odp_control:: - An odp_control is a type of odp_thread. It will be isolated from the host operating system house keeping tasks but will be scheduled by it and may receive interrupts. + An odp_control is a type of odp_thread. It will be isolated from the host + operating system house keeping tasks but will be scheduled by it and may + receive interrupts. odp_thread:: - An odp_thread is a flow of execution that in a Linux environment could be a Linux process or thread. + An odp_thread is a flow of execution that in a Linux environment could be a + Linux process or thread. event:: An event is a notification that can be placed in a queue. -The include structure ---------------------- -Applications only include the 'include/odp.h file which includes the 'platform//include/plat' files to provide a complete definition of the API on that platform. -The doxygen documentation defining the behavior of the ODP API is all contained in the public API files, and the actual definitions for an implementation will be found in the per platform directories. -Per-platform data that might normally be a #define can be recovered via the appropriate access function if the #define is not directly visible to the application. +== The include structure == + +Applications only include the 'include/odp.h' file which includes the +'platform//include/plat' files to provide a complete +definition of the API on that platform. +The doxygen documentation defining the behavior of the ODP API is all contained +in the public API files, and the actual definitions for an implementation will +be found in the per platform directories. +Per-platform data that might normally be a #define can be recovered via the +appropriate access function if the #define is not directly visible to the +application. .Users include structure ---- @@ -451,21 +466,29 @@ Per-platform data that might normally be a #define can be recovered via the appr │   └── odp.h This file should be the only file included by the application. ---- -Initialization --------------- -IMPORTANT: ODP depends on the application to perform a graceful shutdown, calling the terminate functions should only be done when the application is sure it has closed the ingress and subsequently drained all queues etc. +== Initialization == + +IMPORTANT: ODP depends on the application to perform a graceful shutdown, +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 === -Startup -~~~~~~~~ The first API that must be called is 'odp_init_global()'. -This takes two pointers, odp_init_t contains ODP initialization data that is platform independent and portable. -The second odp_platform_init_t is passed un parsed to the implementation and can be used for platform specific data that is not yet, or may never be suitable for the ODP API. +This takes two pointers, +odp_init_t+ contains ODP initialization data that is +platform independent and portable. +The second +odp_platform_init_t+ is passed un parsed to the implementation and +can be used for platform specific data that is not yet, or may never be suitable +for the ODP API. -The second API that must be called is 'odp_init_local()', this must be called once per odp_thread, regardless of odp_thread type. Odp_threads may be of type ODP_THREAD_WORKER or ODP_THREAD_CONTROL +The second API that must be called is 'odp_init_local()', this must be called +once per odp_thread, regardless of odp_thread type. odp_threads may be of type ++ODP_THREAD_WORKER+ or +ODP_THREAD_CONTROL+ -Shutdown -~~~~~~~~~ -Shutdown is the logical reverse of the initialization procedure, with 'odp_thread_term()' called for each worker before 'odp_term_global()' is called. +=== Shutdown === + +Shutdown is the logical reverse of the initialization procedure, with +'odp_thread_term()' called for each worker before 'odp_term_global()' is called. image::../images/resource_management.png[align="center"] @@ -474,27 +497,35 @@ Queues There are three queue types, atomic, ordered and parallel. A queue belongs to a single odp_worker and a odp_worker may have multiple queues. -Events are sent to a queue, and the the sender chooses a queue based on the service it needs. -The sender does not need to know which odp_worker (on which core) or HW accelerator will process the event, but all the events on a queue are eventually scheduled and processed. +Events are sent to a queue, and the the sender chooses a queue based on the +service it needs. +The sender does not need to know which odp_worker (on which core) or HW +accelerator will process the event, but all the events on a queue are eventually +scheduled and processed. -NOTE: Both ordered and parallel queue types improve throughput over an atomic queue (due to parallel event processing), but the user has to take care of the context data synchronization (if needed). +NOTE: Both ordered and parallel queue types improve throughput over an atomic +queue (due to parallel event processing), but the user has to take care of the +context data synchronization (if needed). -Atomic Queue -~~~~~~~~~~~~ -Only one event at a time may be processed from a given queue. The processing maintains order and context data synchronization but this will impair scaling. +=== Atomic Queue === + +Only one event at a time may be processed from a given queue. The processing +maintains order and context data synchronization but this will impair scaling. .Overview Atomic Queue processing image::../images/atomic_queue.png[align="center"] -Ordered Queue -~~~~~~~~~~~~~ -An ordered queue will ensure that the sequencing at the output is identical to that of the input, but multiple events may be processed simultaneously and the order is restored before the events move to the next queue +=== Ordered Queue === + +An ordered queue will ensure that the sequencing at the output is identical to +that of the input, but multiple events may be processed simultaneously and the +order is restored before the events move to the next queue .Overview Ordered Queue processing image::../images/ordered_queue.png[align="center"] -Parallel Queue -~~~~~~~~~~~~~~ +=== Parallel Queue === + There are no restrictions on the number of events being processed. .Overview parallel Queue processing