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 766342BB5 for ; Tue, 16 Jan 2018 06:16:42 +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 w0G5GfUT007929 for unknown; Tue, 16 Jan 2018 14:16:41 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id w0G5GffD025425 for unknown; Tue, 16 Jan 2018 14:16:41 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id QAA25423; Tue, 16 Jan 2018 14:16:41 +0900 Received: from imss03.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id w0G5GfR7009097 for unknown; Tue, 16 Jan 2018 14:16:41 +0900 Received: from mgate02.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id w0G5GfAf009094 for unknown; Tue, 16 Jan 2018 14:16:41 +0900 Message-Id: <201801160516.w0G5GfAf009094@imss03.silk.ntt-tx.co.jp> Received: from localhost by mgate02.silk.ntt-tx.co.jp (unknown) id w0G5Gfwk026680 ; Tue, 16 Jan 2018 14:16:41 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: spp@dpdk.org Date: Tue, 16 Jan 2018 14:16:13 +0900 X-Mailer: git-send-email 1.9.1 In-Reply-To: <3e13a243-6c3f-d849-f2f4-67732e5a44cb@intel.com> References: <3e13a243-6c3f-d849-f2f4-67732e5a44cb@intel.com> X-TM-AS-MML: No Subject: [spp] [PATCH 02/30] doc: add how_to_use.md 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: Tue, 16 Jan 2018 05:16:44 -0000 From: Hiroyuki Nakamura how_to_use.md is a guide for running spp_vf. Signed-off-by: Naoki Takada --- docs/spp_vf/how_to_use.md | 105 ++++++ docs/spp_vf/setup.md | 3 + docs/spp_vf/spp_vf_overview.svg | 793 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 901 insertions(+) create mode 100644 docs/spp_vf/how_to_use.md create mode 100644 docs/spp_vf/spp_vf_overview.svg diff --git a/docs/spp_vf/how_to_use.md b/docs/spp_vf/how_to_use.md new file mode 100644 index 0000000..ca9cf15 --- /dev/null +++ b/docs/spp_vf/how_to_use.md @@ -0,0 +1,105 @@ +# How to Use SPP_VF + +## SPP_VF + +SPP_VF is a SR-IOV like network functionality for NFV. + +![spp_vf_overview](spp_vf_overview.svg) + +## Environment + +* Ubuntu 16.04 +* qemu-kvm +* DPDK v17.05 + +## Launch SPP + +Before launching spp, you need to setup described as [setup guide](setup.md). + +### SPP Controller + +First, run SPP Controller with port numbers for spp primary and secondary. + +```sh +$ python ./src/spp.py -p 5555 -s 6666 +``` + +### SPP Primary + +SPP primary reserves and manages resources for secondary processes. +You have to run it before secondaries. + +Options of spp primary are + * -p : port mask + * -n : number of rings + * -s : ip addr and port of spp primary + +```sh +$ sudo ./src/primary/x86_64-native-linuxapp-gcc/spp_primary \ +-c 0x02 -n 4 --socket-mem 512,512 \ +--huge-dir=/run/hugepages/kvm \ +--proc-type=primary \ +-- -p 0x03 -n 9 -s 127.0.0.1:5555 +``` + +### SPP Secondary + +In `spp_vf`, spp secondary processes are launched by single command. +Core assingment and network configuration are defined +in JSON formatted config file. +If you run `spp_vf` without giving config file, it refers default +config file (test/spp_config/spp_config/vf.json). + +```sh +$ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \ +-c 0x3ffd -n 4 --proc-type=secondary +``` + +You can also indicate which of config you use explicitly with +`--config` option as following example. +Please refer to sample config files in test/spp_config/spp_config. + +[NOTE] Core mask should be changed to correspond with core assingment +defined in each of config files. + +```sh +$ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \ +-c 0x3ffd -n 4 --proc-type=secondary \ +-- --config /path/to/config/spp_vf1.json +``` + +### SPP VM + +Launch VMs with `virsh` command. + +```sh +$ virsh start [VM] +``` + +### Additional Network Configurations + +To enable processes running on the VM to communicate through spp, +it is required additional network configurations on host and guest VMss. + +#### Host1 + +```sh +# Interface for vhost +$ sudo ifconfig [IF_NAME] inet [IP_ADDR] netmask [NETMASK] up + +# Register host2 to arp table +$ sudo arp -s [IP_ADDR] [MAC_ADDR] -i [IF_NAME] + +# Disable offload for vhost interface +$ sudo ethtool -K [IF_NAME] tx off +``` + +#### Host2 + +```sh +# Register VM to arp table +$ sudo arp -s [IP_ADDR] [MAC_ADDR] -i [IF_NAME] + +# Disable offload for VM interface +$ ethtool -K [IF_NAME] tx off +``` diff --git a/docs/spp_vf/setup.md b/docs/spp_vf/setup.md index 572777b..450e68a 100644 --- a/docs/spp_vf/setup.md +++ b/docs/spp_vf/setup.md @@ -168,6 +168,9 @@ Edit VM configuration with virsh. ```sh $ virsh edit [VM_NAME] +``` + +```xml spp-vm1 d90f5420-861a-4479-8559-62d7a1545cb9 diff --git a/docs/spp_vf/spp_vf_overview.svg b/docs/spp_vf/spp_vf_overview.svg new file mode 100644 index 0000000..d0a6769 --- /dev/null +++ b/docs/spp_vf/spp_vf_overview.svg @@ -0,0 +1,793 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + host2 + host1 + rx + tx + + network + rx + tx + + + + + + + + guest + + + rx + tx + rx + tx + vNIC(vhost) + vNIC(vhost) + + + + spp_vf + + + + + + + + + classifier + merger + fwd + fwd + fwd + fwd + + + + + + + + + + + + -- 1.9.1