* [spp] [PATCH 1/6] docs: fix warning for commands section
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
@ 2018-12-06 12:56 ` ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 2/6] docs: revise spp_vf setup section ogawa.yasufumi
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:56 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Spp_vf commands are moved to under `Secondary Commands` section, but
index is not updated for the change. This patch is to update the index.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/commands/index.rst | 1 -
docs/guides/commands/secondary/index.rst | 1 -
2 files changed, 2 deletions(-)
diff --git a/docs/guides/commands/index.rst b/docs/guides/commands/index.rst
index 04442a3..ce67f4b 100644
--- a/docs/guides/commands/index.rst
+++ b/docs/guides/commands/index.rst
@@ -13,6 +13,5 @@ controller.
primary
secondary/index
- spp_vf
common
experimental
diff --git a/docs/guides/commands/secondary/index.rst b/docs/guides/commands/secondary/index.rst
index 5c09d57..5544aea 100644
--- a/docs/guides/commands/secondary/index.rst
+++ b/docs/guides/commands/secondary/index.rst
@@ -6,7 +6,6 @@ Secondary Commands
.. toctree::
:maxdepth: 2
- :numbered:
spp_nfv
spp_vf
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [spp] [PATCH 2/6] docs: revise spp_vf setup section
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 1/6] docs: fix warning for commands section ogawa.yasufumi
@ 2018-12-06 12:56 ` ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 3/6] docs: revise usecase section of spp_vf ogawa.yasufumi
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:56 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Change tag and the filename from build to setup because the section is
`Setup`.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/spp_vf/gsg/build.rst | 387 ---------------------------------------
docs/guides/spp_vf/gsg/index.rst | 2 +-
docs/guides/spp_vf/gsg/setup.rst | 387 +++++++++++++++++++++++++++++++++++++++
3 files changed, 388 insertions(+), 388 deletions(-)
delete mode 100644 docs/guides/spp_vf/gsg/build.rst
create mode 100644 docs/guides/spp_vf/gsg/setup.rst
diff --git a/docs/guides/spp_vf/gsg/build.rst b/docs/guides/spp_vf/gsg/build.rst
deleted file mode 100644
index 656a388..0000000
--- a/docs/guides/spp_vf/gsg/build.rst
+++ /dev/null
@@ -1,387 +0,0 @@
-.. SPDX-License-Identifier: BSD-3-Clause
- Copyright(c) 2010-2014 Intel Corporation
-
-.. _spp_vf_gsg_build:
-
-Setup
-=====
-
-This section describes how to setup ``spp_vf`` and ``spp_mirror``.
-
-
-Environment
------------
-
-Here is a recommended versions of each of software.
-
-* Ubuntu 16.04
-* qemu-kvm 2.7 or later
-
-.. note::
-
- If you do not use ``--vhost-client`` described in
- :ref:`How to Use<spp_vf_gsg_howto_use_spp_mirror>`
- , you can use previous versions of qemu-kvm.
-
-
-Edit Config
------------
-
-Uncomment user and group in ``/etc/libvirt/qemu.conf``.
-
-.. code-block:: console
-
- # /etc/libvirt/qemu.conf
-
- user = "root"
- group = "root"
-
-To use hugepages with libvirt, change ``KVM_HUGEPAGES`` from 0 to 1
-in ``/etc/default/qemu-kvm``.
-
-.. code-block:: console
-
- # /etc/default/qemu-kvm
-
- KVM_HUGEPAGES=1
-
-Change grub configuration for hugepages and isolcpus features. It is defined
-as ``GRUB_CMDLINE_LINUX_DEFAULT`` and takes parameters.
-
-* isolcpus: Core IDs separated with commna, such as ``2,3,4,8``
-* hugepagesz: The size of hugepage, such as ``2M`` or ``1G``
-* hugepages: The number of hugepages, such as ``8``
-* default_hugepagesz: Default hugepage size, required only for ``1G``
-
-In this setup guide, configure ``hugepagez`` and its default is ``1G`` and
-the number of hugepages is ``36``.
-Core IDs of for ``isolcpus`` depends on your environment and usecase,
-but should be configured to have enough number of cores.
-
-.. code-block:: c
-
- # /etc/default/grub
-
- GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=2,...,46 hugepagesz=1G hugepages=..."
-
-For hugepages, isolcpus, refer to the dpdk documentation below.
-
-* `Use of Hugepages in the Linux Environment
- <http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html#running-dpdk-applications>`_
-* `Using Linux Core Isolation to Reduce Context Switches
- <http://dpdk.org/doc/guides/linux_gsg/enable_func.html#using-linux-core-isolation-to-reduce-context-switches>`_
-* `Linux boot command line
- <http://dpdk.org/doc/guides/linux_gsg/nic_perf_intel_platform.html#linux-boot-command-line>`_
-
-You need to run ``update-grub`` and reboot to activate grub config.
-
-.. code-block:: console
-
- $ sudo update-grub
- $ sudo reboot
-
-
-You can check hugepage settings as following.
-
-.. code-block:: console
-
- $ cat /proc/meminfo | grep -i huge
- AnonHugePages: 2048 kB
- HugePages_Total: 36 # /etc/default/grub
- HugePages_Free: 36
- HugePages_Rsvd: 0
- HugePages_Surp: 0
- Hugepagesize: 1048576 kB # /etc/default/grub
-
- $ mount | grep -i huge
- cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,...,nsroot=/)
- hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
- hugetlbfs-kvm on /run/hugepages/kvm type hugetlbfs (rw,...,gid=117)
- hugetlb on /run/lxcfs/controllers/hugetlb type cgroup (rw,...,nsroot=/)
-
-Finally, you umount default hugepage.
-
-.. code-block:: console
-
- $ sudo umount /dev/hugepages
-
-
-Install DPDK
-------------
-
-Install DPDK in any directory. This is a simple instruction and please
-refer
-`Getting Started Guide for Linux
-<http://dpdk.org/doc/guides/linux_gsg/index.html>`_
-for details.
-
-.. code-block:: console
-
- $ cd /path/to/any_dir
- $ git clone http://dpdk.org/git/dpdk
- $ cd dpdk
- $ git checkout [TAG_NAME(e.g. v17.05)]
- $ export RTE_SDK=`pwd`
- $ export RTE_TARGET=x86_64-native-linuxapp-gcc
- $ make T=x86_64-native-linuxapp-gcc install
-
-
-Install SPP
------------
-
-Clone SPP in any directory and compile it.
-
-.. code-block:: console
-
- $ cd /path/to/any_dir
- $ git clone http://dpdk.org/git/apps/spp
- $ cd spp
- $ make
-
-Setup for DPDK
---------------
-
-Load igb_uio module.
-
-.. code-block:: console
-
- $ sudo modprobe uio
- $ sudo insmod $RTE_SDK/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
- $ lsmod | grep uio
- igb_uio 16384 0 # igb_uio is loaded
- uio 20480 1 igb_uio
-
-Then, bind your devices with PCI number by using ``dpdk-devbind.py``.
-PCI number is inspected
-
-.. code-block:: console
-
- # check your device for PCI_Number
- $ $RTE_SDK/usertools/dpdk-devbind.py --status
-
- $ sudo $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio PCI_NUM
-
-
-virsh setup
------------
-
-First of all, please check version of qemu-kvm.
-
-.. code-block:: console
-
- $ qemu-system-x86_64 --version
-
-If your system does not have qemu-kvm or the version of qemu is less than 2.7,
-then please install qemu following
-the instruction of https://wiki.qemu.org/index.php/Hosts/Linux
-to install qemu 2.7.
-You may need to install libvirt-bin,
-virtinst, bridge-utils packages via ``apt-get`` install to run
-``virt-install``.
-
-
-``virsh`` is a command line interface that can be used to create, destroy,
-stop start and edit VMs and configure. After create an image file,
-you can setup it with ``virt-install``.
-``--location`` is a URL of installer and it should be
-``http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/``
-for amd64.
-
-.. code-block:: console
-
- virt-install \
- --name [VM_NAME] \
- --ram 4096 \
- --disk path=/var/lib/libvirt/images/[VM_NAME].img,size=30 \
- --vcpus 4 \
- --os-type linux \
- --os-variant ubuntu16.04 \
- --network network=default \
- --graphics none \
- --console pty,target_type=serial \
- --location '[LOCATION]' \
- --extra-args 'console=ttyS0,115200n8 serial'
-
-You may need type the following commands through ssh to activate console.
-
-.. code-block:: console
-
- $sudo systemctl enable serial-getty@ttyS0.service
- $sudo systemctl start serial-getty@ttyS0.service
-
-
-Edit VM configuration with virsh.
-
-.. code-block:: console
-
- $ virsh edit [VM_NAME]
-
-You need to add ``xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'``
-into the domain tag because of adding ``<qemu:commandline>`` tag.
-In addition, you need to add the tag enclosed by ``<memoryBacking>`` and
-``</memoryBacking>``, ``<qemu:commandline>`` and ``</qemu:commandline>``
-because SPP uses vhost-user as interface with VM.
-Note that number used in those tags should be the same value
-(e.g. chr0,sock0,vhost-net0) and these values should correspond
-to "add vhost N" (in this example 0).
-MAC address used in
-``<qemu:arg value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>``
-can be specified when registering MAC address to classifier
-using Secondary command.
-
- The following is an example of modified xml file:
-
-.. code-block:: xml
-
- <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
- <name>spp-vm1</name>
- <uuid>d90f5420-861a-4479-8559-62d7a1545cb9</uuid>
- <memory unit='KiB'>4194304</memory>
- <currentMemory unit='KiB'>4194304</currentMemory>
- <memoryBacking>
- <hugepages/>
- </memoryBacking>
- <vcpu placement='static'>4</vcpu>
- <os>
- <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
- <boot dev='hd'/>
- </os>
- <features>
- <acpi/>
- <apic/>
- <pae/>
- </features>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>restart</on_crash>
- <devices>
- <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
- <disk type='file' device='disk'>
- <driver name='qemu' type='raw'/>
- <source file='/var/lib/libvirt/images/spp-vm1.qcow2'/>
- <target dev='hda' bus='ide'/>
- <address type='drive' controller='0' bus='0' target='0' unit='0'/>
- </disk>
- <disk type='block' device='cdrom'>
- <driver name='qemu' type='raw'/>
- <target dev='hdc' bus='ide'/>
- <readonly/>
- <address type='drive' controller='0' bus='1' target='0' unit='0'/>
- </disk>
- <controller type='usb' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
- function='0x2'/>
- </controller>
- <controller type='pci' index='0' model='pci-root'/>
- <controller type='ide' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
- function='0x1'/>
- </controller>
- <interface type='network'>
- <mac address='52:54:00:99:aa:7f'/>
- <source network='default'/>
- <model type='rtl8139'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
- function='0x0'/>
- </interface>
- <serial type='pty'>
- <target type='isa-serial' port='0'/>
- </serial>
- <console type='pty'>
- <target type='serial' port='0'/>
- </console>
- <memballoon model='virtio'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
- function='0x0'/>
- </memballoon>
- </devices>
- <qemu:commandline>
- <qemu:arg value='-cpu'/>
- <qemu:arg value='host'/>
- <qemu:arg value='-object'/>
- <qemu:arg
- value='memory-backend-file,id=mem,size=4096M,mem-path=/run/hugepages/kvm,share=on'/>
- <qemu:arg value='-numa'/>
- <qemu:arg value='node,memdev=mem'/>
- <qemu:arg value='-mem-prealloc'/>
- <qemu:arg value='-chardev'/>
- <qemu:arg value='socket,id=chr0,path=/tmp/sock0,server'/>
- <qemu:arg value='-device'/>
- <qemu:arg
- value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>
- <qemu:arg value='-netdev'/>
- <qemu:arg value='vhost-user,id=vhost-net0,chardev=chr0,vhostforce'/>
- <qemu:arg value='-chardev'/>
- <qemu:arg value='socket,id=chr1,path=/tmp/sock1,server'/>
- <qemu:arg value='-device'/>
- <qemu:arg
- value='virtio-net-pci,netdev=vhost-net1,mac=52:54:00:12:34:57'/>
- <qemu:arg value='-netdev'/>
- <qemu:arg value='vhost-user,id=vhost-net1,chardev=chr1,vhostforce'/>
- </qemu:commandline>
- </domain>
-
-
-Setup spp_mirror
-----------------
-
-Setup of ``spp_mirror`` is almost the same as :ref:`SPP VF<spp_vf_gsg_build>`.
-Configuration of use of ``shallowcopy`` or ``deepcopy`` is different from
-``spp_vf``.
-It is defined in ``src/mirror/Makefile`` and which of copying is used is
-configured by editing ``CFLAG`` option. It is defined to use ``shallowcopy``
-by default.
-
-If you use ``deepcopy``, comment out the line of ``-Dspp_mirror_SHALLOWCOPY``
-to be disabled.
-
-.. code-block:: c
-
- #CFLAGS += -Dspp_mirror_SHALLOWCOPY
-
-Then, run make command to compile ``spp_mirror``.
-
-.. code-block:: console
-
- $ make
-
-
-Trouble Shooting Guide
-----------------------
-
-You might encounter a permission error for ``tmp/sockN`` because
-of appamor.
-In this case, you should try it.
-
-.. code-block:: console
-
- #Edit /etc/libvirt/qemu.conf and set security_driver to none:
- $sudo vi /etc/libvirt/qemu.conf
- ...
- security_driver = "none"
- ...
- #Restart libvirtd:
- $sudo systemctl restart libvirtd.service
-
-Or, you remove appamor.
-
-.. code-block:: console
-
- $ sudo apt-get remove apparmor
-
-If you use CentOS, not Ubuntu, confirm that SELinux doesn't prevent
-for permission.
-SELinux should be disabled in this case.
-
-.. code-block:: console
-
- # /etc/selinux/config
- SELINUX=disabled
-
-Check your SELinux configuration.
-
-.. code-block:: console
-
- $ getenforce
- Disabled
diff --git a/docs/guides/spp_vf/gsg/index.rst b/docs/guides/spp_vf/gsg/index.rst
index 5661887..c0bc0a7 100644
--- a/docs/guides/spp_vf/gsg/index.rst
+++ b/docs/guides/spp_vf/gsg/index.rst
@@ -7,5 +7,5 @@ Getting Started
.. toctree::
:maxdepth: 2
- build
+ setup
howto_use
diff --git a/docs/guides/spp_vf/gsg/setup.rst b/docs/guides/spp_vf/gsg/setup.rst
new file mode 100644
index 0000000..41c103a
--- /dev/null
+++ b/docs/guides/spp_vf/gsg/setup.rst
@@ -0,0 +1,387 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+ Copyright(c) 2010-2014 Intel Corporation
+
+.. _spp_vf_gsg_setup:
+
+Setup
+=====
+
+This section describes how to setup ``spp_vf`` and ``spp_mirror``.
+
+
+Environment
+-----------
+
+Here is a recommended versions of each of software.
+
+* Ubuntu 16.04
+* qemu-kvm 2.7 or later
+
+.. note::
+
+ If you do not use ``--vhost-client`` as described in
+ :ref:`How to Use<spp_vf_gsg_howto_use_spp_vf>`
+ of spp_vf, you can use previous versions of qemu-kvm.
+
+
+Edit Config
+-----------
+
+Uncomment user and group in ``/etc/libvirt/qemu.conf``.
+
+.. code-block:: console
+
+ # /etc/libvirt/qemu.conf
+
+ user = "root"
+ group = "root"
+
+To use hugepages with libvirt, change ``KVM_HUGEPAGES`` from 0 to 1
+in ``/etc/default/qemu-kvm``.
+
+.. code-block:: console
+
+ # /etc/default/qemu-kvm
+
+ KVM_HUGEPAGES=1
+
+Change grub configuration for hugepages and isolcpus features. It is defined
+as ``GRUB_CMDLINE_LINUX_DEFAULT`` and takes parameters.
+
+* isolcpus: Core IDs separated with commna, such as ``2,3,4,8``
+* hugepagesz: The size of hugepage, such as ``2M`` or ``1G``
+* hugepages: The number of hugepages, such as ``8``
+* default_hugepagesz: Default hugepage size, required only for ``1G``
+
+In this setup guide, configure ``hugepagez`` and its default is ``1G`` and
+the number of hugepages is ``36``.
+Core IDs of for ``isolcpus`` depends on your environment and usecase,
+but should be configured to have enough number of cores.
+
+.. code-block:: c
+
+ # /etc/default/grub
+
+ GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=2,...,46 hugepagesz=1G hugepages=..."
+
+For hugepages, isolcpus, refer to the dpdk documentation below.
+
+* `Use of Hugepages in the Linux Environment
+ <http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html#running-dpdk-applications>`_
+* `Using Linux Core Isolation to Reduce Context Switches
+ <http://dpdk.org/doc/guides/linux_gsg/enable_func.html#using-linux-core-isolation-to-reduce-context-switches>`_
+* `Linux boot command line
+ <http://dpdk.org/doc/guides/linux_gsg/nic_perf_intel_platform.html#linux-boot-command-line>`_
+
+You need to run ``update-grub`` and reboot to activate grub config.
+
+.. code-block:: console
+
+ $ sudo update-grub
+ $ sudo reboot
+
+
+You can check hugepage settings as following.
+
+.. code-block:: console
+
+ $ cat /proc/meminfo | grep -i huge
+ AnonHugePages: 2048 kB
+ HugePages_Total: 36 # /etc/default/grub
+ HugePages_Free: 36
+ HugePages_Rsvd: 0
+ HugePages_Surp: 0
+ Hugepagesize: 1048576 kB # /etc/default/grub
+
+ $ mount | grep -i huge
+ cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,...,nsroot=/)
+ hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
+ hugetlbfs-kvm on /run/hugepages/kvm type hugetlbfs (rw,...,gid=117)
+ hugetlb on /run/lxcfs/controllers/hugetlb type cgroup (rw,...,nsroot=/)
+
+Finally, you umount default hugepage.
+
+.. code-block:: console
+
+ $ sudo umount /dev/hugepages
+
+
+Install DPDK
+------------
+
+Install DPDK in any directory. This is a simple instruction and please
+refer
+`Getting Started Guide for Linux
+<http://dpdk.org/doc/guides/linux_gsg/index.html>`_
+for details.
+
+.. code-block:: console
+
+ $ cd /path/to/any_dir
+ $ git clone http://dpdk.org/git/dpdk
+ $ cd dpdk
+ $ git checkout [TAG_NAME(e.g. v17.05)]
+ $ export RTE_SDK=`pwd`
+ $ export RTE_TARGET=x86_64-native-linuxapp-gcc
+ $ make T=x86_64-native-linuxapp-gcc install
+
+
+Install SPP
+-----------
+
+Clone SPP in any directory and compile it.
+
+.. code-block:: console
+
+ $ cd /path/to/any_dir
+ $ git clone http://dpdk.org/git/apps/spp
+ $ cd spp
+ $ make
+
+Setup for DPDK
+--------------
+
+Load igb_uio module.
+
+.. code-block:: console
+
+ $ sudo modprobe uio
+ $ sudo insmod $RTE_SDK/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
+ $ lsmod | grep uio
+ igb_uio 16384 0 # igb_uio is loaded
+ uio 20480 1 igb_uio
+
+Then, bind your devices with PCI number by using ``dpdk-devbind.py``.
+PCI number is inspected
+
+.. code-block:: console
+
+ # check your device for PCI_Number
+ $ $RTE_SDK/usertools/dpdk-devbind.py --status
+
+ $ sudo $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio PCI_NUM
+
+
+virsh setup
+-----------
+
+First of all, please check version of qemu-kvm.
+
+.. code-block:: console
+
+ $ qemu-system-x86_64 --version
+
+If your system does not have qemu-kvm or the version of qemu is less than 2.7,
+then please install qemu following
+the instruction of https://wiki.qemu.org/index.php/Hosts/Linux
+to install qemu 2.7.
+You may need to install libvirt-bin,
+virtinst, bridge-utils packages via ``apt-get`` install to run
+``virt-install``.
+
+
+``virsh`` is a command line interface that can be used to create, destroy,
+stop start and edit VMs and configure. After create an image file,
+you can setup it with ``virt-install``.
+``--location`` is a URL of installer and it should be
+``http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/``
+for amd64.
+
+.. code-block:: console
+
+ virt-install \
+ --name [VM_NAME] \
+ --ram 4096 \
+ --disk path=/var/lib/libvirt/images/[VM_NAME].img,size=30 \
+ --vcpus 4 \
+ --os-type linux \
+ --os-variant ubuntu16.04 \
+ --network network=default \
+ --graphics none \
+ --console pty,target_type=serial \
+ --location '[LOCATION]' \
+ --extra-args 'console=ttyS0,115200n8 serial'
+
+You may need type the following commands through ssh to activate console.
+
+.. code-block:: console
+
+ $sudo systemctl enable serial-getty@ttyS0.service
+ $sudo systemctl start serial-getty@ttyS0.service
+
+
+Edit VM configuration with virsh.
+
+.. code-block:: console
+
+ $ virsh edit [VM_NAME]
+
+You need to add ``xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'``
+into the domain tag because of adding ``<qemu:commandline>`` tag.
+In addition, you need to add the tag enclosed by ``<memoryBacking>`` and
+``</memoryBacking>``, ``<qemu:commandline>`` and ``</qemu:commandline>``
+because SPP uses vhost-user as interface with VM.
+Note that number used in those tags should be the same value
+(e.g. chr0,sock0,vhost-net0) and these values should correspond
+to "add vhost N" (in this example 0).
+MAC address used in
+``<qemu:arg value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>``
+can be specified when registering MAC address to classifier
+using Secondary command.
+
+ The following is an example of modified xml file:
+
+.. code-block:: xml
+
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+ <name>spp-vm1</name>
+ <uuid>d90f5420-861a-4479-8559-62d7a1545cb9</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <memoryBacking>
+ <hugepages/>
+ </memoryBacking>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source file='/var/lib/libvirt/images/spp-vm1.qcow2'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
+ function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
+ function='0x1'/>
+ </controller>
+ <interface type='network'>
+ <mac address='52:54:00:99:aa:7f'/>
+ <source network='default'/>
+ <model type='rtl8139'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
+ function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
+ function='0x0'/>
+ </memballoon>
+ </devices>
+ <qemu:commandline>
+ <qemu:arg value='-cpu'/>
+ <qemu:arg value='host'/>
+ <qemu:arg value='-object'/>
+ <qemu:arg
+ value='memory-backend-file,id=mem,size=4096M,mem-path=/run/hugepages/kvm,share=on'/>
+ <qemu:arg value='-numa'/>
+ <qemu:arg value='node,memdev=mem'/>
+ <qemu:arg value='-mem-prealloc'/>
+ <qemu:arg value='-chardev'/>
+ <qemu:arg value='socket,id=chr0,path=/tmp/sock0,server'/>
+ <qemu:arg value='-device'/>
+ <qemu:arg
+ value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>
+ <qemu:arg value='-netdev'/>
+ <qemu:arg value='vhost-user,id=vhost-net0,chardev=chr0,vhostforce'/>
+ <qemu:arg value='-chardev'/>
+ <qemu:arg value='socket,id=chr1,path=/tmp/sock1,server'/>
+ <qemu:arg value='-device'/>
+ <qemu:arg
+ value='virtio-net-pci,netdev=vhost-net1,mac=52:54:00:12:34:57'/>
+ <qemu:arg value='-netdev'/>
+ <qemu:arg value='vhost-user,id=vhost-net1,chardev=chr1,vhostforce'/>
+ </qemu:commandline>
+ </domain>
+
+
+Setup spp_mirror
+----------------
+
+Setup of ``spp_mirror`` is almost the same as :ref:`SPP VF<spp_vf_gsg_setup>`.
+Configuration of use of ``shallowcopy`` or ``deepcopy`` is different from
+``spp_vf``.
+It is defined in ``src/mirror/Makefile`` and which of copying is used is
+configured by editing ``CFLAG`` option. It is defined to use ``shallowcopy``
+by default.
+
+If you use ``deepcopy``, comment out the line of ``-Dspp_mirror_SHALLOWCOPY``
+to be disabled.
+
+.. code-block:: c
+
+ #CFLAGS += -Dspp_mirror_SHALLOWCOPY
+
+Then, run make command to compile ``spp_mirror``.
+
+.. code-block:: console
+
+ $ make
+
+
+Trouble Shooting Guide
+----------------------
+
+You might encounter a permission error for ``tmp/sockN`` because
+of appamor.
+In this case, you should try it.
+
+.. code-block:: console
+
+ #Edit /etc/libvirt/qemu.conf and set security_driver to none:
+ $sudo vi /etc/libvirt/qemu.conf
+ ...
+ security_driver = "none"
+ ...
+ #Restart libvirtd:
+ $sudo systemctl restart libvirtd.service
+
+Or, you remove appamor.
+
+.. code-block:: console
+
+ $ sudo apt-get remove apparmor
+
+If you use CentOS, not Ubuntu, confirm that SELinux doesn't prevent
+for permission.
+SELinux should be disabled in this case.
+
+.. code-block:: console
+
+ # /etc/selinux/config
+ SELINUX=disabled
+
+Check your SELinux configuration.
+
+.. code-block:: console
+
+ $ getenforce
+ Disabled
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [spp] [PATCH 3/6] docs: revise usecase section of spp_vf
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 1/6] docs: fix warning for commands section ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 2/6] docs: revise spp_vf setup section ogawa.yasufumi
@ 2018-12-06 12:56 ` ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 4/6] docs: add tags for sections " ogawa.yasufumi
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:56 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
* Update descriptions for the latest update. Correct secondary command
to `vf` or `mirror` and Revise command line examples.
* Correct usage of level of headerline.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/spp_vf/use_cases/usecase1.rst | 247 ++++++++++++++++--------------
docs/guides/spp_vf/use_cases/usecase2.rst | 104 +++++++------
2 files changed, 189 insertions(+), 162 deletions(-)
diff --git a/docs/guides/spp_vf/use_cases/usecase1.rst b/docs/guides/spp_vf/use_cases/usecase1.rst
index 4a8f4bc..c6cd9e1 100644
--- a/docs/guides/spp_vf/use_cases/usecase1.rst
+++ b/docs/guides/spp_vf/use_cases/usecase1.rst
@@ -20,8 +20,8 @@ port.
Simple SSH Login
-Launch SPP VF
-~~~~~~~~~~~~~
+Launch SPP Processes
+--------------------
Change directory to spp and confirm that it is already compiled.
@@ -29,15 +29,19 @@ Change directory to spp and confirm that it is already compiled.
$ cd /path/to/spp
-As spp, launch controller first. You notice that SPP VF has its own
-controller ``spp_vf.py`` and do not use ``spp.py``.
+Launch ``spp-ctl`` before launching SPP primary and secondary processes.
+You also need to launch ``spp.py`` if you use ``spp_vf`` from CLI.
+``-b`` option is for binding IP address to communicate other SPP processes,
+but no need to give it explicitly if ``127.0.0.1`` or ``localhost`` although
+doing explicitly in this example to be more understandable.
.. code-block:: console
- # Launch spp_vf.py
- $ python ./src/spp_vf.py -p 5555 -s 6666
+ # Launch spp-ctl and spp.py
+ $ python3 ./src/spp-ctl/spp-ctl -b 127.0.0.1
+ $ python ./src/spp.py -b 127.0.0.1
-Then, run ``spp_primary``.
+Then, run ``spp_primary`` on the second core with ``-c 0x02``.
.. code-block:: console
@@ -50,6 +54,8 @@ Then, run ``spp_primary``.
-p 0x03 -n 8 -s 127.0.0.1:5555
After ``spp_primary`` is launched, run secondary process ``spp_vf``.
+Core mask ``-c 0x3ffd`` indicates to use twelve cores except the second
+core, and it equals to ``-l 0,2-12``.
.. code-block:: console
@@ -62,7 +68,7 @@ After ``spp_primary`` is launched, run secondary process ``spp_vf``.
Network Configuration
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
Detailed configuration of :numref:`figure_simple_ssh_login` is
described below.
@@ -86,7 +92,7 @@ sent to SSH clinet via NIC0.
You need to input a little bit large amount of commands for the
configuration, or use ``playback`` command to load from config files.
You can find a series of config files for this use case in
-``docs/samples/command/spp_vf/usecase1/``.
+``recipes/spp_vf/usecase1/``.
First, lanch threads of SPP VF called ``component`` with its core ID
and a directive for behaviour.
@@ -94,7 +100,7 @@ It is launched from ``component`` subcommand with options.
.. code-block:: console
- spp > sec [SEC_ID];component start [NAME] [CORE_ID] [BEHAVIOUR]
+ spp > sec SEC_ID; component start NAME CORE_ID BEHAVIOUR
In this usecase, spp_vf is launched with ID=1. Let's start components
for the first login path.
@@ -105,12 +111,12 @@ Core ID from 2 to 7 are assigned to each of components.
.. code-block:: console
# Start component to spp_vf
- spp > sec 1;component start classifier1 2 classifier_mac
- spp > sec 1;component start forwarder1 3 forward
- spp > sec 1;component start forwarder2 4 forward
- spp > sec 1;component start forwarder3 5 forward
- spp > sec 1;component start forwarder4 6 forward
- spp > sec 1;component start merger1 7 merge
+ spp > vf 1; component start classifier1 2 classifier_mac
+ spp > vf 1; component start forwarder1 3 forward
+ spp > vf 1; component start forwarder2 4 forward
+ spp > vf 1; component start forwarder3 5 forward
+ spp > vf 1; component start forwarder4 6 forward
+ spp > vf 1; component start merger1 7 merge
Each of components must have rx and tx ports for forwarding.
Add ports for each of components as following.
@@ -120,25 +126,30 @@ merger has two rx ports.
.. code-block:: console
# classifier1
- spp > sec 1;port add phy:0 rx classifier1
- spp > sec 1;port add ring:0 tx classifier1
- spp > sec 1;port add ring:1 tx classifier1
+ spp > vf 1; port add phy:0 rx classifier1
+ spp > vf 1; port add ring:0 tx classifier1
+ spp > vf 1; port add ring:1 tx classifier1
+
# forwarder1
- spp > sec 1;port add ring:0 rx forwarder1
- spp > sec 1;port add vhost:0 tx forwarder1
+ spp > vf 1; port add ring:0 rx forwarder1
+ spp > vf 1; port add vhost:0 tx forwarder1
+
# forwarder2
- spp > sec 1;port add ring:1 rx forwarder2
- spp > sec 1;port add vhost:2 tx forwarder2
+ spp > vf 1; port add ring:1 rx forwarder2
+ spp > vf 1; port add vhost:2 tx forwarder2
+
# forwarder3
- spp > sec 1;port add vhost:0 rx forwarder3
- spp > sec 1;port add ring:2 tx forwarder3
+ spp > vf 1; port add vhost:0 rx forwarder3
+ spp > vf 1; port add ring:2 tx forwarder3
+
# forwarder4
- spp > sec 1;port add vhost:2 rx forwarder4
- spp > sec 1;port add ring:3 tx forwarder4
+ spp > vf 1; port add vhost:2 rx forwarder4
+ spp > vf 1; port add ring:3 tx forwarder4
+
# merger1
- spp > sec 1;port add ring:2 rx merger1
- spp > sec 1;port add ring:3 rx merger1
- spp > sec 1;port add phy:0 tx merger1
+ spp > vf 1; port add ring:2 rx merger1
+ spp > vf 1; port add ring:3 rx merger1
+ spp > vf 1; port add phy:0 tx merger1
As given ``classifier_mac``, classifier component decides
the destination with MAC address by referring ``classifier_table``.
@@ -147,20 +158,17 @@ MAC address and corresponging port is registered to the table with
.. code-block:: console
- spp > [SEC_ID];classifier_table add mac [MACADDRESS] [PORT]
+ spp > vf SEC_ID; classifier_table add mac MAC_ADDR PORT
-In this usecase, you need to register two MAC addresses for merger1.
+In this usecase, you need to register two MAC addresses of targetting VM
+for merger1.
.. code-block:: console
# Register MAC address to classifier
- spp > sec 1;classifier_table add mac 52:54:00:12:34:56 ring:0
- spp > sec 1;classifier_table add mac 52:54:00:12:34:58 ring:1
-
-.. note::
+ spp > vf 1; classifier_table add mac 52:54:00:12:34:56 ring:0
+ spp > vf 1; classifier_table add mac 52:54:00:12:34:58 ring:1
- Please verify that MAC address of target VM is specified in
- [MACADDRESS] parameter.
Configuration for the second login path is almost similar to the first
path.
@@ -169,56 +177,58 @@ Start components with core ID 8-13 and directives.
.. code-block:: console
- spp > sec 1;component start classifier2 8 classifier_mac
- spp > sec 1;component start forwarder5 9 forward
- spp > sec 1;component start forwarder6 10 forward
- spp > sec 1;component start forwarder7 11 forward
- spp > sec 1;component start forwarder8 12 forward
- spp > sec 1;component start merger2 13 merge
+ spp > vf 1; component start classifier2 8 classifier_mac
+ spp > vf 1; component start forwarder5 9 forward
+ spp > vf 1; component start forwarder6 10 forward
+ spp > vf 1; component start forwarder7 11 forward
+ spp > vf 1; component start forwarder8 12 forward
+ spp > vf 1; component start merger2 13 merge
Add ports to each of components.
.. code-block:: console
# classifier2
- spp > sec 1;port add phy:1 rx classifier2
- spp > sec 1;port add ring:4 tx classifier2
- spp > sec 1;port add ring:5 tx classifier2
+ spp > vf 1; port add phy:1 rx classifier2
+ spp > vf 1; port add ring:4 tx classifier2
+ spp > vf 1; port add ring:5 tx classifier2
+
# forwarder5
- spp > sec 1;port add ring:4 rx forwarder5
- spp > sec 1;port add vhost:1 tx forwarder5
+ spp > vf 1; port add ring:4 rx forwarder5
+ spp > vf 1; port add vhost:1 tx forwarder5
+
# forwarder6
- spp > sec 1;port add ring:5 rx forwarder6
- spp > sec 1;port add vhost:3 tx forwarder6
+ spp > vf 1; port add ring:5 rx forwarder6
+ spp > vf 1; port add vhost:3 tx forwarder6
+
# forwarder7
- spp > sec 1;port add vhost:1 rx forwarder7
- spp > sec 1;port add ring:6 tx forwarder7
+ spp > vf 1; port add vhost:1 rx forwarder7
+ spp > vf 1; port add ring:6 tx forwarder7
+
# forwarder8
- spp > sec 1;port add vhost:3 rx forwarder8
- spp > sec 1;port add ring:7 tx forwarder8
+ spp > vf 1; port add vhost:3 rx forwarder8
+ spp > vf 1; port add ring:7 tx forwarder8
+
# merger2
- spp > sec 1;port add ring:6 rx merger2
- spp > sec 1;port add ring:7 rx merger2
- spp > sec 1;port add phy:1 tx merger2
+ spp > vf 1; port add ring:6 rx merger2
+ spp > vf 1; port add ring:7 rx merger2
+ spp > vf 1; port add phy:1 tx merger2
-Register entries to classifier_table for classifier2.
+Register entries to classifier_table for classifier2 with MAC address
+of targetting VM..
.. code-block:: console
# Register MAC address to classifier
- spp > sec 1;classifier_table add mac 52:54:00:12:34:57 ring:4
- spp > sec 1;classifier_table add mac 52:54:00:12:34:59 ring:5
+ spp > vf 1; classifier_table add mac 52:54:00:12:34:57 ring:4
+ spp > vf 1; classifier_table add mac 52:54:00:12:34:59 ring:5
-.. note::
-
- Please verify that MAC address of target VM is specified in
- [MACADDRESS] parameter.
Setup for VMs
-~~~~~~~~~~~~~
+-------------
Launch VM1 and VM2 with virsh command.
-Setup for virsh is described in :ref:`spp_vf_gsg_build`.
+Setup for virsh is described in :ref:`spp_vf_gsg_setup`.
.. code-block:: console
@@ -264,7 +274,7 @@ Configurations also for ``spp-vm2`` as ``spp-vm1``.
Login to VMs
-~~~~~~~~~~~~
+------------
Now, you can login to VMs from the remote host1.
@@ -282,10 +292,11 @@ Now, you can login to VMs from the remote host1.
# spp-vm2 via NIC1
$ ssh sppuser@192.168.150.32
+
.. _spp_vf_use_cases_usecase1_shutdown_spp_vf_components:
-Shutdown SPP VF Components
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+Shutdown spp_vf Components
+--------------------------
Basically, you can shutdown all of SPP processes with ``bye all``
command.
@@ -297,43 +308,46 @@ for the first SSH login path.
.. code-block:: console
# Delete MAC address from Classifier
- spp > sec 1;classifier_table del mac 52:54:00:12:34:56 ring:0
- spp > sec 1;classifier_table del mac 52:54:00:12:34:58 ring:1
+ spp > vf 1; classifier_table del mac 52:54:00:12:34:56 ring:0
+ spp > vf 1; classifier_table del mac 52:54:00:12:34:58 ring:1
.. code-block:: console
# classifier1
- spp > sec 1;port del phy:0 rx classifier1
- spp > sec 1;port del ring:0 tx classifier1
- spp > sec 1;port del ring:1 tx classifier1
+ spp > vf 1; port del phy:0 rx classifier1
+ spp > vf 1; port del ring:0 tx classifier1
+ spp > vf 1; port del ring:1 tx classifier1
# forwarder1
- spp > sec 1;port del ring:0 rx forwarder1
- spp > sec 1;port del vhost:0 tx forwarder1
+ spp > vf 1; port del ring:0 rx forwarder1
+ spp > vf 1; port del vhost:0 tx forwarder1
# forwarder2
- spp > sec 1;port del ring:1 rx forwarder2
- spp > sec 1;port del vhost:2 tx forwarder2
+ spp > vf 1; port del ring:1 rx forwarder2
+ spp > vf 1; port del vhost:2 tx forwarder2
+
# forwarder3
- spp > sec 1;port del vhost:0 rx forwarder3
- spp > sec 1;port del ring:2 tx forwarder3
+ spp > vf 1; port del vhost:0 rx forwarder3
+ spp > vf 1; port del ring:2 tx forwarder3
+
# forwarder4
- spp > sec 1;port del vhost:2 rx forwarder4
- spp > sec 1;port del ring:3 tx forwarder4
+ spp > vf 1; port del vhost:2 rx forwarder4
+ spp > vf 1; port del ring:3 tx forwarder4
+
# merger1
- spp > sec 1;port del ring:2 rx merger1
- spp > sec 1;port del ring:3 rx merger1
- spp > sec 1;port del phy:0 tx merger1
+ spp > vf 1; port del ring:2 rx merger1
+ spp > vf 1; port del ring:3 rx merger1
+ spp > vf 1; port del phy:0 tx merger1
Then, stop components.
.. code-block:: console
# Stop component to spp_vf
- spp > sec 1;component stop classifier1
- spp > sec 1;component stop forwarder1
- spp > sec 1;component stop forwarder2
- spp > sec 1;component stop forwarder3
- spp > sec 1;component stop forwarder4
- spp > sec 1;component stop merger1
+ spp > vf 1; component stop classifier1
+ spp > vf 1; component stop forwarder1
+ spp > vf 1; component stop forwarder2
+ spp > vf 1; component stop forwarder3
+ spp > vf 1; component stop forwarder4
+ spp > vf 1; component stop merger1
Second, do termination for the second path.
Delete entries from ``classifier_table`` and ports from each of
@@ -342,40 +356,45 @@ components.
.. code-block:: console
# Delete MAC address from Classifier
- spp > sec 1;classifier_table del mac 52:54:00:12:34:57 ring:4
- spp > sec 1;classifier_table del mac 52:54:00:12:34:59 ring:5
+ spp > vf 1; classifier_table del mac 52:54:00:12:34:57 ring:4
+ spp > vf 1; classifier_table del mac 52:54:00:12:34:59 ring:5
.. code-block:: console
# classifier2
- spp > sec 1;port del phy:1 rx classifier2
- spp > sec 1;port del ring:4 tx classifier2
- spp > sec 1;port del ring:5 tx classifier2
+ spp > vf 1; port del phy:1 rx classifier2
+ spp > vf 1; port del ring:4 tx classifier2
+ spp > vf 1; port del ring:5 tx classifier2
+
# forwarder5
- spp > sec 1;port del ring:4 rx forwarder5
- spp > sec 1;port del vhost:1 tx forwarder5
+ spp > vf 1; port del ring:4 rx forwarder5
+ spp > vf 1; port del vhost:1 tx forwarder5
+
# forwarder6
- spp > sec 1;port del ring:5 rx forwarder6
- spp > sec 1;port del vhost:3 tx forwarder6
+ spp > vf 1; port del ring:5 rx forwarder6
+ spp > vf 1; port del vhost:3 tx forwarder6
+
# forwarder7
- spp > sec 1;port del vhost:1 rx forwarder7
- spp > sec 1;port del ring:6 tx forwarder7
+ spp > vf 1; port del vhost:1 rx forwarder7
+ spp > vf 1; port del ring:6 tx forwarder7
+
# forwarder8
- spp > sec 1;port del vhost:3 tx forwarder8
- spp > sec 1;port del ring:7 rx forwarder8
+ spp > vf 1; port del vhost:3 tx forwarder8
+ spp > vf 1; port del ring:7 rx forwarder8
+
# merger2
- spp > sec 1;port del ring:6 rx merger2
- spp > sec 1;port del ring:7 rx merger2
- spp > sec 1;port del phy:1 tx merger2
+ spp > vf 1; port del ring:6 rx merger2
+ spp > vf 1; port del ring:7 rx merger2
+ spp > vf 1; port del phy:1 tx merger2
Then, stop components.
.. code-block:: console
# Stop component to spp_vf
- spp > sec 1;component stop classifier2
- spp > sec 1;component stop forwarder5
- spp > sec 1;component stop forwarder6
- spp > sec 1;component stop forwarder7
- spp > sec 1;component stop forwarder8
- spp > sec 1;component stop merger2
+ spp > vf 1; component stop classifier2
+ spp > vf 1; component stop forwarder5
+ spp > vf 1; component stop forwarder6
+ spp > vf 1; component stop forwarder7
+ spp > vf 1; component stop forwarder8
+ spp > vf 1; component stop merger2
diff --git a/docs/guides/spp_vf/use_cases/usecase2.rst b/docs/guides/spp_vf/use_cases/usecase2.rst
index b59229a..71a8fcb 100644
--- a/docs/guides/spp_vf/use_cases/usecase2.rst
+++ b/docs/guides/spp_vf/use_cases/usecase2.rst
@@ -10,11 +10,19 @@ Mirroring packet from a VM
This section describes a usage for mirroring from a VM to other VM through
spp_mirror. Traffic from host2 is forwarded to each VM inside host1 thorough
-spp_vf. spp_vf is required to forward traffic from host NIC to each VM.
+``spp_vf``. ``spp_vf`` is required in usecase to forward traffic
+from host NIC to each VM.
-In this usecase, spp-ctl should be started first. And then primary process
-should be started with -n 16 like following because for giving enough number
-of rings.
+.. _figure_simple_mirroring:
+
+.. figure:: ../../images/spp_vf/spp_mirror_usecase_overview.*
+ :width: 60%
+
+ Mirroring from a VM
+
+
+Launch SPP Processes
+--------------------
Move to spp directory.
@@ -22,13 +30,20 @@ Move to spp directory.
$cd /path/to/spp
-Start spp-ctl using python3.
+Launch ``spp-ctl`` before launching SPP primary and secondary processes.
+You also need to launch ``spp.py`` if you use ``spp_vf`` from CLI.
+``-b`` option is for binding IP address to communicate other SPP processes,
+but no need to give it explicitly if ``127.0.0.1`` or ``localhost`` although
+doing explicitly in this example to be more understandable.
.. code-block:: console
- $ python3 ./src/spp-ctl/spp-ctl
+ # Launch spp-ctl and spp.py
+ $ python3 ./src/spp-ctl/spp-ctl -b 127.0.0.1
+ $ python ./src/spp.py -b 127.0.0.1
-Start spp_primary with core id 1.
+Start spp_primary with core list option ``-l 1``. It should be started
+with ``-n 16`` for giving enough number of rings.
.. code-block:: console
@@ -41,20 +56,9 @@ Start spp_primary with core id 1.
-- \
-p 0x03 -n 16 -s 127.0.0.1:5555
-.. _figure_simple_mirroring:
-.. figure:: ../../images/spp_vf/spp_mirror_usecase_overview.*
- :width: 60%
-
- Mirroring from a VM
-
-VM for spp_vf
--------------
-
-The first step is creating VM1 for running ``spp_vf``.
-A process of ``spp_vf`` is started with core list ``0,2-14`` in this usecase.
-
-Start spp_vf with core list 0,2-14.
+Then, create VM1 ``spp_vf`` and launch ``spp_vf`` with core list
+``-l 0,2-14`` in this usecase.
.. code-block:: console
@@ -65,7 +69,7 @@ Start spp_vf with core list 0,2-14.
-s 127.0.0.1:6666 \
--vhost-client
-Start components for spp_vf.
+Start components in ``spp_vf``.
.. code-block:: console
@@ -128,7 +132,7 @@ Mirroring with spp_mirror
The second step is starting with creating VM running with spp_mirror.
Network Configuration
-^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~
Incoming packets from NIC are forwarded to VM1 through spp_vf.
@@ -144,7 +148,8 @@ During that path, mirror component mirror1 replicates packet to merger3.
Network configuration of mirroring
Launch spp_mirror
-^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~
+
Change directory to spp and confirm that it is already compiled.
.. code-block:: console
@@ -168,48 +173,51 @@ Run secondary process ``spp_mirror``.
should not be overlapped each otherand. It is also the same for core list
``-l``.
-Start mirror component with core id 15.
+Start mirror component with core ID 15.
.. code-block:: console
# Start component of spp_mirror on coreID 15
- spp > sec 2;component start mirror1 15 mirror
+ spp > sec 2; component start mirror1 15 mirror
-Add ring:0 as rx ports and add ring:8 and ring:9 as tx port to mirror.
+Add ``ring:0`` as rx ports and add ``ring:8`` and ``ring:9`` as tx port
+to mirror.
.. code-block:: console
# mirror1
- spp > mirror 2;port add ring:0 rx mirror1
- spp > mirror 2;port add ring:8 tx mirror1
- spp > mirror 2;port add ring:9 tx mirror1
+ spp > mirror 2; port add ring:0 rx mirror1
+ spp > mirror 2; port add ring:8 tx mirror1
+ spp > mirror 2; port add ring:9 tx mirror1
-Start merger3 with core id 14.
+Start ``merger3`` with core ID 14.
.. code-block:: console
# Start component of spp_vf on coreID 14
- spp > vf 1;component start merger3 14 forward
+ spp > vf 1; component start merger3 14 forward
-Add ring:9 as rx port of merger3 and vhost:4 as tx port of merger3.
+Add ``ring:9`` as rx port of ``merger3`` and ``vhost:4`` as
+tx port of ``merger3``.
.. code-block:: console
# merger3
- spp > vf 1;port add ring:9 rx merger3
- spp > vf 1;port add vhost:4 tx merger3
+ spp > vf 1; port add ring:9 rx merger3
+ spp > vf 1; port add vhost:4 tx merger3
-Delete ring:0 as rx port of forwarder1 and ring:8 as rx port of forwarder1.
+Delete ``ring:0`` as rx port of ``forwarder1`` and ``ring:8`` as
+rx port of ``forwarder1``.
.. code-block:: console
# forward1
- spp > vf 1;port del ring:0 rx forwarder1
- spp > vf 1;port add ring:8 rx forwarder1
+ spp > vf 1; port del ring:0 rx forwarder1
+ spp > vf 1; port add ring:8 rx forwarder1
Receive packet on VM3
-^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~
You can capture incoming packets on VM3.
If you capture packet on VM1, the same packet would be captured.
@@ -228,7 +236,7 @@ Now, you can send packet from the remote host1.
Stop Mirroring
-^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~
Firstly, delete ports for components.
@@ -237,30 +245,30 @@ Delete ports for components.
.. code-block:: console
# Delete port for mirror1
- spp > mirror 2;port del ring:0 rx mirror1
- spp > mirror 2;port del ring:8 tx mirror1
- spp > mirror 2;port del ring:9 tx mirror1
+ spp > mirror 2; port del ring:0 rx mirror1
+ spp > mirror 2; port del ring:8 tx mirror1
+ spp > mirror 2; port del ring:9 tx mirror1
# Delete port for merger3
- spp > vf 1;port del ring:9 rx merger3
- spp > vf 1;port del vhost:4 tx merger3
+ spp > vf 1; port del ring:9 rx merger3
+ spp > vf 1; port del vhost:4 tx merger3
# Delete port for forwarder1
- spp > vf 1;port del ring:8 rx forwarder1
+ spp > vf 1; port del ring:8 rx forwarder1
Next, stop components.
.. code-block:: console
# Stop mirror
- spp > mirror 2;component stop mirror1 15 mirror
+ spp > mirror 2; component stop mirror1 15 mirror
# Stop merger
- spp > vf 1;component stop merger3 14 forward
+ spp > vf 1; component stop merger3 14 forward
Add port from classifier_mac1 to VM1.
.. code-block:: console
# Add port from classifier_mac1 to VM1.
- spp > vf 1;port add ring:0 rx forwarder1
+ spp > vf 1; port add ring:0 rx forwarder1
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [spp] [PATCH 4/6] docs: add tags for sections of spp_vf
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
` (2 preceding siblings ...)
2018-12-06 12:56 ` [spp] [PATCH 3/6] docs: revise usecase section of spp_vf ogawa.yasufumi
@ 2018-12-06 12:56 ` ogawa.yasufumi
2018-12-06 12:56 ` [spp] [PATCH 5/6] docs: remove html static path ogawa.yasufumi
2018-12-06 12:57 ` [spp] [PATCH 6/6] docs: revise explanation of usecases of spp_vf ogawa.yasufumi
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:56 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Add tags for sections of spp_vf can bre referred.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/overview.rst | 2 ++
docs/guides/spp_vf/gsg/howto_use.rst | 3 +++
docs/guides/spp_vf/overview.rst | 2 +-
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/guides/overview.rst b/docs/guides/overview.rst
index 386ac49..1140cd6 100644
--- a/docs/guides/overview.rst
+++ b/docs/guides/overview.rst
@@ -1,6 +1,8 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2010-2014 Intel Corporation
+.. _spp_overview:
+
Soft Patch Panel
==================
diff --git a/docs/guides/spp_vf/gsg/howto_use.rst b/docs/guides/spp_vf/gsg/howto_use.rst
index 52a9c54..44bc77a 100644
--- a/docs/guides/spp_vf/gsg/howto_use.rst
+++ b/docs/guides/spp_vf/gsg/howto_use.rst
@@ -46,6 +46,9 @@ Then, spp primary can be launched like this.
-- \
-p 0x03 -n 9 -s 127.0.0.1:5555
+
+.. _spp_vf_gsg_howto_use_spp_vf:
+
spp_vf
------
diff --git a/docs/guides/spp_vf/overview.rst b/docs/guides/spp_vf/overview.rst
index dd957d4..446beb0 100644
--- a/docs/guides/spp_vf/overview.rst
+++ b/docs/guides/spp_vf/overview.rst
@@ -54,7 +54,7 @@ by looking up destination MAC address in the packet.
Overview of spp_vf
-SPP Mirror
+spp_mirror
----------
``spp_mirror`` is an implementation of
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [spp] [PATCH 5/6] docs: remove html static path
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
` (3 preceding siblings ...)
2018-12-06 12:56 ` [spp] [PATCH 4/6] docs: add tags for sections " ogawa.yasufumi
@ 2018-12-06 12:56 ` ogawa.yasufumi
2018-12-06 12:57 ` [spp] [PATCH 6/6] docs: revise explanation of usecases of spp_vf ogawa.yasufumi
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:56 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
To fix warning of no static files, remove nouse entry `_static` from
`html_static_path`.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/conf.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/guides/conf.py b/docs/guides/conf.py
index 7341663..c8d00b4 100644
--- a/docs/guides/conf.py
+++ b/docs/guides/conf.py
@@ -80,7 +80,8 @@ html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+#html_static_path = ['_static']
+html_static_path = []
# html_logo = 'images/logo/spp_logo2.svg'
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [spp] [PATCH 6/6] docs: revise explanation of usecases of spp_vf
2018-12-06 12:56 [spp] [PATCH 0/6] Update docs of spp_vf and spp_mirror ogawa.yasufumi
` (4 preceding siblings ...)
2018-12-06 12:56 ` [spp] [PATCH 5/6] docs: remove html static path ogawa.yasufumi
@ 2018-12-06 12:57 ` ogawa.yasufumi
5 siblings, 0 replies; 7+ messages in thread
From: ogawa.yasufumi @ 2018-12-06 12:57 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Revise explanation of usecases of spp_vf to be more understandable.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/spp_vf/gsg/setup.rst | 2 ++
docs/guides/spp_vf/use_cases/usecase1.rst | 4 ++-
docs/guides/spp_vf/use_cases/usecase2.rst | 52 ++++++++++++++-----------------
3 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/docs/guides/spp_vf/gsg/setup.rst b/docs/guides/spp_vf/gsg/setup.rst
index 41c103a..9053519 100644
--- a/docs/guides/spp_vf/gsg/setup.rst
+++ b/docs/guides/spp_vf/gsg/setup.rst
@@ -162,6 +162,8 @@ PCI number is inspected
$ sudo $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio PCI_NUM
+.. _spp_vf_gsg_virsh_setup:
+
virsh setup
-----------
diff --git a/docs/guides/spp_vf/use_cases/usecase1.rst b/docs/guides/spp_vf/use_cases/usecase1.rst
index c6cd9e1..0c1976d 100644
--- a/docs/guides/spp_vf/use_cases/usecase1.rst
+++ b/docs/guides/spp_vf/use_cases/usecase1.rst
@@ -224,11 +224,13 @@ of targetting VM..
spp > vf 1; classifier_table add mac 52:54:00:12:34:59 ring:5
+.. _spp_vf_use_cases_usecase1_setup_vm:
+
Setup for VMs
-------------
Launch VM1 and VM2 with virsh command.
-Setup for virsh is described in :ref:`spp_vf_gsg_setup`.
+Setup for virsh is described in :ref:`spp_vf_gsg_virsh_setup`.
.. code-block:: console
diff --git a/docs/guides/spp_vf/use_cases/usecase2.rst b/docs/guides/spp_vf/use_cases/usecase2.rst
index 71a8fcb..c7f62e4 100644
--- a/docs/guides/spp_vf/use_cases/usecase2.rst
+++ b/docs/guides/spp_vf/use_cases/usecase2.rst
@@ -13,7 +13,7 @@ spp_mirror. Traffic from host2 is forwarded to each VM inside host1 thorough
``spp_vf``. ``spp_vf`` is required in usecase to forward traffic
from host NIC to each VM.
-.. _figure_simple_mirroring:
+.. _figure_mirroring_from_vm:
.. figure:: ../../images/spp_vf/spp_mirror_usecase_overview.*
:width: 60%
@@ -21,14 +21,25 @@ from host NIC to each VM.
Mirroring from a VM
-Launch SPP Processes
---------------------
+Network Configuration
+---------------------
-Move to spp directory.
+Detailed configuration of :numref:`figure_mirroring_from_vm` is described in
+:numref:`figure_spp_mirror_usecase_nwconfig`.
+In this senario, incoming packets though ``ring1`` are mirrored.
+In ``spp_mirror`` process, worker thread ``mirror1`` copies incoming packets and
+sends to orignal destination ``VM1`` and new one ``VM3``.
-.. code-block:: console
+.. _figure_spp_mirror_usecase_nwconfig:
- $cd /path/to/spp
+.. figure:: ../../images/spp_vf/spp_mirror_usecase_nwconfig.*
+ :width: 80%
+
+ Network configuration of mirroring
+
+
+Setup SPP and VMs
+-----------------
Launch ``spp-ctl`` before launching SPP primary and secondary processes.
You also need to launch ``spp.py`` if you use ``spp_vf`` from CLI.
@@ -38,6 +49,8 @@ doing explicitly in this example to be more understandable.
.. code-block:: console
+ $cd /path/to/spp
+
# Launch spp-ctl and spp.py
$ python3 ./src/spp-ctl/spp-ctl -b 127.0.0.1
$ python ./src/spp.py -b 127.0.0.1
@@ -57,8 +70,11 @@ with ``-n 16`` for giving enough number of rings.
-p 0x03 -n 16 -s 127.0.0.1:5555
-Then, create VM1 ``spp_vf`` and launch ``spp_vf`` with core list
-``-l 0,2-14`` in this usecase.
+Launch spp_vf
+~~~~~~~~~~~~~
+
+Launch ``VM1`` as described in :ref:`spp_vf_use_cases_usecase1_setup_vm`,
+and launch ``spp_vf`` with core list ``-l 0,2-14`` in this usecase.
.. code-block:: console
@@ -126,26 +142,6 @@ You send packets from the remote host1 and confirm packets are received.
$ ping 192.168.140.21
-Mirroring with spp_mirror
--------------------------
-
-The second step is starting with creating VM running with spp_mirror.
-
-Network Configuration
-~~~~~~~~~~~~~~~~~~~~~
-
-Incoming packets from NIC are forwarded to VM1 through spp_vf.
-
-Detailed configuration of :numref:`figure_simple_mirroring` is
-described below. There are two NICs on the host to send and receive packets.
-During that path, mirror component mirror1 replicates packet to merger3.
-
-.. _figure_spp_mirror_usecase_nwconfig:
-
- .. figure:: ../../images/spp_vf/spp_mirror_usecase_nwconfig.*
- :width: 80%
-
- Network configuration of mirroring
Launch spp_mirror
~~~~~~~~~~~~~~~~~
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread