From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 840C61B5ED for ; Thu, 10 Jan 2019 11:28:00 +0100 (CET) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0AARwZJ018158; Thu, 10 Jan 2019 19:27:58 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 9293A63892D; Thu, 10 Jan 2019 19:27:58 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 83D05638919; Thu, 10 Jan 2019 19:27:58 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 10 Jan 2019 19:25:41 +0900 Message-Id: <1547115947-27671-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547115947-27671-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1547086216-27422-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> <1547115947-27671-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH v2 2/8] docs: add desc of design of spp_nfv X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2019 10:28:01 -0000 From: Yasufumi Ogawa Add descriptions of overview of design of spp_nfv in design section. Signed-off-by: Yasufumi Ogawa --- docs/guides/design/spp_secondary.rst | 52 +++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/docs/guides/design/spp_secondary.rst b/docs/guides/design/spp_secondary.rst index b3bb270..9d11f74 100644 --- a/docs/guides/design/spp_secondary.rst +++ b/docs/guides/design/spp_secondary.rst @@ -2,7 +2,7 @@ Copyright(c) 2019 Nippon Telegraph and Telephone Corporation -.. _spp_design_spp_secondary: +.. _spp_design_spp_sec: SPP Secondary ============= @@ -32,9 +32,55 @@ a simple pseudo SR-IOV feature for classifying or merging packets. ``spp_mirror`` is to duplicate incoming packets to several destination ports. -.. _spp_design_spp_secondary_nfv: +.. _spp_design_spp_sec_nfv: spp_nfv ------- -``spp_nfv`` is ... +``spp_nfv`` is the simplest SPP secondary to connect two of processes or other +feature ports. Each of ``spp_nfv`` processes has a list of entries including +source and destination ports, and forwards packets by referring the list. +It means that one ``spp_nfv`` might have several forwarding paths, but +throughput is gradually decreased if it has too much paths. +This list is implemented as an array of ``port`` structure and named +``ports_fwd_array``. The index of ``ports_fwd_array`` is the same as unique +port ID. + +.. code-block:: c + + struct port { + int in_port_id; + int out_port_id; + ... + }; + ... + + /* ports_fwd_array is an array of port */ + static struct port ports_fwd_array[RTE_MAX_ETHPORTS]; + +:numref:`figure_design_spp_sec_nfv_port_fwd_array` describes an example of +forwarding between ports. In this case, ``spp_nfv`` is responsible for +forwarding from ``port#0`` to ``port#2``. You notice that each of ``out_port`` +entry has the destination port ID. + +.. _figure_design_spp_sec_nfv_port_fwd_array: + +.. figure:: ../images/design/spp_design_spp_sec_nfv.* + :width: 75% + + Forwarding by referring ports_fwd_array + +``spp_nfv`` consists of main thread and worker thread to update the entry +while running the process. Main thread is for waiting user command for +updating the entry. Worker thread is for dedicating packet forwarding. +:numref:`figure_design_spp_sec_nfv_threads` describes tasks in each of +threads. Worker thread is launched from main thread after initialization. +In worker thread, it starts forwarding if user send forward command and +main thread accepts it. + +.. _figure_design_spp_sec_nfv_threads: + +.. figure:: ../images/design/spp_design_spp_sec_nfv_threads.* + :width: 70% + + Main thread and worker thread in spp_nfv -- 2.7.4