From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id 88D981B54A for ; Fri, 30 Nov 2018 06:43:33 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id wAU5hWXj001654; Fri, 30 Nov 2018 14:43:32 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id wAU5hWYb028367; Fri, 30 Nov 2018 14:43:32 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id QAA27156; Fri, 30 Nov 2018 14:41:19 +0900 Received: from imss04.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss04.silk.ntt-tx.co.jp (unknown) with ESMTP id wAU5fJvw001781; Fri, 30 Nov 2018 14:41:19 +0900 Received: from mgate01.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss04.silk.ntt-tx.co.jp (unknown) with ESMTP id wAU5fJlX001778; Fri, 30 Nov 2018 14:41:19 +0900 Message-Id: <201811300541.wAU5fJlX001778@imss04.silk.ntt-tx.co.jp> Received: from localhost by mgate01.silk.ntt-tx.co.jp (unknown) id wAU5fJ5O014150 ; Fri, 30 Nov 2018 14:41:19 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Cc: spp@dpdk.org Date: Fri, 30 Nov 2018 14:41:11 +0900 X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181130054118.24543-1-x-fn-spp@sl.ntt-tx.co.jp> References: <20181130054118.24543-1-x-fn-spp@sl.ntt-tx.co.jp> X-TM-AS-MML: No Subject: [spp] [PATCH 03/10] docs: add design for spp_mirror 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: Fri, 30 Nov 2018 05:43:34 -0000 From: Hideyuki Yamashita Design section is for describing components and its mechanizm of `spp_vf` and `spp_mirror`. Signed-off-by: Yasufumi Ogawa Signed-off-by: Hideyuki Yamashita --- docs/guides/images/spp_vf/spp_mirror_design.svg | 564 ++++++++++++++++++++++++ docs/guides/spp_vf/design.rst | 75 +++- 2 files changed, 623 insertions(+), 16 deletions(-) create mode 100644 docs/guides/images/spp_vf/spp_mirror_design.svg diff --git a/docs/guides/images/spp_vf/spp_mirror_design.svg b/docs/guides/images/spp_vf/spp_mirror_design.svg new file mode 100644 index 0000000..bd1da65 --- /dev/null +++ b/docs/guides/images/spp_vf/spp_mirror_design.svg @@ -0,0 +1,564 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + host + + + spp_mirror + + + mirror + + + ring:1 + ring:0 + + diff --git a/docs/guides/spp_vf/design.rst b/docs/guides/spp_vf/design.rst index fc9b014..8b9e7f3 100644 --- a/docs/guides/spp_vf/design.rst +++ b/docs/guides/spp_vf/design.rst @@ -6,8 +6,22 @@ Design ====== -Components ----------- +.. _spp_vf_design_port: + +Ports +----- + +Both of ``spp_vf`` and ``spp_mirror`` support three types of port, +``phy``, ``ring`` and ``vhost``. +``phy`` port is used to retrieve packets from specific physical NIC or sent to. +``ring`` is basically used to connect a process or a thread to make a network +path between them. +``vhost`` is used to forward packets from a VM or sent to. + +.. _spp_vf_design_spp_vf: + +spp_vf +------ ``spp_vf`` is a kind of secondary process and consists of several threads called component. @@ -15,23 +29,23 @@ There are three types of components, ``forwarder``, ``merger`` and ``classifier``. .. figure:: ../images/spp_vf/spp_vf_overview.* - :width: 70% + :width: 75% SPP VF components Forwarder -~~~~~~~~~ +^^^^^^^^^ Simply forwards packets from rx to tx port. Merger -~~~~~~ +^^^^^^ Receives packets from multiple rx ports to aggregate packets and sends to a desctination port. Classifier -~~~~~~~~~~ +^^^^^^^^^^ Sends packets to multiple tx ports based on entries of MAC address and destination port in a classifier table. @@ -43,15 +57,44 @@ which of table is referred if TPID (Tag Protocol Indetifier) is included in a packet and equals to 0x8100 as defined in IEEE 802.1Q standard. +.. _spp_vf_design_spp_mirror: -Ports ------ +spp_mirror +---------- + +``spp_mirror`` is another kind of secondary process. The keyword ``mirror`` +means that it duplicates incoming packets and forwards to additional +destination. +It supports only one type of component called ``mirror`` for duplicating. +In :numref:`figure_spp_mirror_design`, incoming packets are duplicated with +``mirror`` component and sent to original and additional destinations. + +.. _figure_spp_mirror_design: + +.. figure:: ../images/spp_vf/spp_mirror_design.* + :width: 45% + + Spp_mirror component + +Mirror +^^^^^^ + +``mirror`` component has one ``rx`` port and two ``tx`` ports. Incoming packets +from ``rx`` port are duplicated and sent to each of ``tx`` ports. + +In general, copying packet is time-consuming because it requires to make a new +region on memory space. Considering to minimize impact for performance, +``spp_mirror`` provides a choice of copying methods, ``shallowocopy`` or +``deepcopy``. +The difference between those methods is ``shallowocopy`` does not copy whole of +packet data but share without header actually. +``shallowcopy`` is to share mbuf between packets to get better performance +than ``deepcopy``, but it should be used for read only for the packet. + +.. note:: + + ``shallowcopy`` calls ``rte_pktmbuf_clone()`` internally and + ``deepcopy`` create a new mbuf region. -``spp_vf`` supports three types of PMDs, ``phy`` (Physical NIC), -``ring`` (Ring PMD) and ``vhost`` (vhsot PMD). -Using ``phy`` port, component can get incoming packets from outside host -and transfer the packet to specific physical NIC. -Using ``ring`` port, variety of combination of components can be -configured. -And through ``vhost`` port component can transfer packets from/to VMs. -``port`` can also control vlan tagging and untagging. +You should choose ``deepcopy`` if you use VLAN feature to make no change for +original packet while copied packet is modified. -- 2.7.4