From patchwork Mon Nov 2 17:41:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 55905 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp1396141lbr; Mon, 2 Nov 2015 09:42:25 -0800 (PST) X-Received: by 10.50.20.3 with SMTP id j3mr11692116ige.73.1446486145510; Mon, 02 Nov 2015 09:42:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id sb12si10929393igb.46.2015.11.02.09.42.25; Mon, 02 Nov 2015 09:42: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 D88C661B76; Mon, 2 Nov 2015 17:42: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 9EED261B3D; Mon, 2 Nov 2015 17:41:33 +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 E28CD61B2C; Mon, 2 Nov 2015 17:41:29 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by lists.linaro.org (Postfix) with ESMTPS id 4CE7561B1B for ; Mon, 2 Nov 2015 17:41:26 +0000 (UTC) Received: by qkct129 with SMTP id t129so1465776qkc.2 for ; Mon, 02 Nov 2015 09:41:26 -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:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=56sJXdKbmvDgcs81RIUEQ+WvE0UftmsX7QJkH+tiCdc=; b=D0Mkppy65Azp9TrsL0G6zbxzWNEJLov8zMZZeGVMugOoPFhKpEaH/BuZLdnSwLqh1s xqXK4VmOJklIrqwQumSm9o2cGEp3mBtwTvmqcY3kkLnuEoM3p/wOJfz9YIKh71G5gkpH h/Hq276Y3b3OLCxPLHmFGxAeKrlwU9QydAnq8KLSOKiuvTUnhVF8ThVbGnXOBqazIlQg oaxtlKz1XwXlVB6XEj+1DKr/EwWRa/AHJWkeqm3ECjP3XFbbsZGtkkJC3iXiDwc6ql90 QlizIHAhaQrbzRqfJZbWenx3mQVnug/3h6bffL2rk04e1kEAF3scsEndxBh97Qy+J4aR nAuw== 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:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=56sJXdKbmvDgcs81RIUEQ+WvE0UftmsX7QJkH+tiCdc=; b=eh8yqjoaautRGncwdl1ESYILIlcodWSlhfAf/khuJNJjM/IuV8Yt+LmNfxhG34uT66 HrUBuPgxXfDuuwSKhyRS8l/fbfFTXwooxokbPr5A+18FTLokm6S6uS9FaveBglAKrUOM kRAmbJlPV503IE1DAp1EURmXSzhHVYivBr1EWtDJdocbm6OWht2Ikgt5yL7CSD4AylUt vcoJUUVPXr2d6/flUlrJv2JIiy5tZoxDsl5Kw0HEI433kJirV0Eec4wxE98cGOp10M2n GRAgAftxwYw2ksvT4Fff5jEcQA6bG1ikbZFE7A2Ac/ULLfzNSAoRqP0wHyt+OMQRqvFk QkOA== X-Gm-Message-State: ALoCoQm7vTvSL7tiOxu2tNnfTRKbDYMgd/EVwPA7mQOYpW28fogctdAO66mojNycHRqGma5jsxYX X-Received: by 10.55.74.19 with SMTP id x19mr31339250qka.28.1446486085829; Mon, 02 Nov 2015 09:41:25 -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 r67sm8299312qki.17.2015.11.02.09.41.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Nov 2015 09:41:25 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 2 Nov 2015 12:41:17 -0500 Message-Id: <1446486077-14973-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446486077-14973-1-git-send-email-mike.holmes@linaro.org> References: <1446486077-14973-1-git-send-email-mike.holmes@linaro.org> MIME-Version: 1.0 X-Topics: patch Subject: [lng-odp] [PATCH v2 3/3] doc: users-guide convert to asciidoc 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 --- v2: clarified workers vs control as per Maxims comment configure.ac | 1 + doc/Makefile.am | 2 +- doc/users-guide/Makefile.am | 10 +++++ doc/users-guide/guide.dox | 14 ------ doc/users-guide/users-guide.adoc | 96 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 15 deletions(-) create mode 100644 doc/users-guide/Makefile.am delete mode 100644 doc/users-guide/guide.dox create mode 100644 doc/users-guide/users-guide.adoc diff --git a/configure.ac b/configure.ac index d9669b9..b8a2876 100644 --- a/configure.ac +++ b/configure.ac @@ -316,6 +316,7 @@ AM_CXXFLAGS="-std=c++11" AC_CONFIG_FILES([Makefile doc/Makefile doc/implementers-guide/Makefile + doc/users-guide/Makefile doc/images/Makefile example/Makefile example/classifier/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index 3aa29a3..16d2160 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -6,5 +6,5 @@ clean-local: endif if user_guide -SUBDIRS += implementers-guide +SUBDIRS += implementers-guide users-guide endif diff --git a/doc/users-guide/Makefile.am b/doc/users-guide/Makefile.am new file mode 100644 index 0000000..312358d --- /dev/null +++ b/doc/users-guide/Makefile.am @@ -0,0 +1,10 @@ +TARGET = $(top_srcdir)/doc/output/users-guide.html + +all-local: $(TARGET) + +$(TARGET): users-guide.adoc + @mkdir -p $(top_srcdir)/doc/output + asciidoc --out-file=$@ $< + +clean-local: + rm -f $(TARGET) diff --git a/doc/users-guide/guide.dox b/doc/users-guide/guide.dox deleted file mode 100644 index f9289b8..0000000 --- a/doc/users-guide/guide.dox +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * - * @page users_guide Users Guide - * - * @section sec_gene Linux Generic - * @verbinclude linux-generic/README - * - */ diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc new file mode 100644 index 0000000..7f70046 --- /dev/null +++ b/doc/users-guide/users-guide.adoc @@ -0,0 +1,96 @@ +OpenDataPlane (ODP) Users-Guide +================================ +:toc: + + +:numbered!: +[abstract] +Abstract +-------- +This document is intended to guide a new ODP application developer. +Further details about ODP may be found at then 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. + +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. +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. +odp_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. + +:numbered: +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 +---- +./ +├── include/ +│   ├── odp/ +│   │   └── api/ +│   │   └── The Public API and the documentation. +│   │ +│   └── 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. + +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. + +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. + +image::../images/resource_management.png[align="center"] + +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. + +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. + +.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 + +.Overview Ordered Queue processing +image::../images/ordered_queue.png[align="center"] + +Parallel Queue +~~~~~~~~~~~~~~ +There are no restrictions on the number of events being processed. + +.Overview parallel Queue processing +image::../images/parallel_queue.png[align="center"]